Skip to content

Commit 6b31460

Browse files
committed
Fix checkstyle: Suppress line length warning in CSVParser.
1 parent 4a5611c commit 6b31460

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ CSV files of various types.
201201
<configuration>
202202
<configLocation>${basedir}/checkstyle.xml</configLocation>
203203
<enableRulesSummary>false</enableRulesSummary>
204+
<suppressionsLocation>${basedir}/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
204205
</configuration>
205206
</plugin>
206207
<!-- Allow findbugs to be run interactively; keep in sync with report config below -->
@@ -270,6 +271,7 @@ CSV files of various types.
270271
<configuration>
271272
<configLocation>${basedir}/checkstyle.xml</configLocation>
272273
<enableRulesSummary>false</enableRulesSummary>
274+
<suppressionsLocation>${basedir}/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
273275
</configuration>
274276
<!-- We need to specify reportSets because 2.9.1 creates two reports -->
275277
<reportSets>

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ private Headers createHeaders() throws IOException {
501501
if (!emptyHeader && !this.format.getAllowDuplicateHeaderNames()) {
502502
throw new IllegalArgumentException(
503503
String.format(
504-
"The header contains a duplicate name: \"%s\" in %s. " +
505-
"If this is valid then use CSVFormat.withAllowDuplicateHeaderNames().",
504+
"The header contains a duplicate name: \"%s\" in %s. If this is valid then use CSVFormat.withAllowDuplicateHeaderNames().",
506505
header, Arrays.toString(headerRecord)));
507506
}
508507
if (emptyHeader && !this.format.getAllowMissingColumnNames()) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!DOCTYPE suppressions PUBLIC
19+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
20+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
21+
<suppressions>
22+
<suppress checks="LineLength" files="[\\/]CSVParser\.java$" lines="504"/>
23+
</suppressions>

0 commit comments

Comments
 (0)