This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 1.x in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git
commit 4da7e1b47b09a9dd7db2bab7a52139dbfacbfad3 Author: Mark Thomas <[email protected]> AuthorDate: Tue Jan 31 17:23:33 2023 +0000 Fix checkstyle report for site --- pom.xml | 35 +++++++++++++++++-- src/checkstyle/checkstyle-suppressions.xml | 4 +-- src/checkstyle/fileupload_checks.xml | 54 +++++++++++++++--------------- 3 files changed, 62 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index d5c7529..1465859 100644 --- a/pom.xml +++ b/pom.xml @@ -252,6 +252,28 @@ <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <executions> + <execution> + <id>validate-main</id> + <phase>validate</phase> + <configuration> + <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation> + <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation> + <includeTestSourceDirectory>false</includeTestSourceDirectory> + <enableRulesSummary>false</enableRulesSummary> + <consoleOutput>true</consoleOutput> + <failsOnError>true</failsOnError> + <linkXRef>false</linkXRef> + </configuration> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> @@ -328,6 +350,16 @@ </lifecycleMappingMetadata> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation> + <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation> + <includeTestSourceDirectory>false</includeTestSourceDirectory> + <enableRulesSummary>false</enableRulesSummary> + </configuration> + </plugin> </plugins> </pluginManagement> </build> @@ -353,12 +385,11 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.10</version> <configuration> <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation> <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation> + <includeTestSourceDirectory>false</includeTestSourceDirectory> <enableRulesSummary>false</enableRulesSummary> - <headerLocation>${basedir}/src/checkstyle/license-header.txt</headerLocation> </configuration> </plugin> <plugin> diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 28ba446..e40eb4e 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC - "-//Puppy Crawl//DTD Suppressions 1.0//EN" - "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> + "-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN" + "https://checkstyle.org/dtds/suppressions_1_0.dtd"> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with diff --git a/src/checkstyle/fileupload_checks.xml b/src/checkstyle/fileupload_checks.xml index b49a4f4..568c0bf 100644 --- a/src/checkstyle/fileupload_checks.xml +++ b/src/checkstyle/fileupload_checks.xml @@ -17,8 +17,8 @@ --> <!DOCTYPE module PUBLIC - "-//Puppy Crawl//DTD Check Configuration 1.1//EN" - "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> + "-//Checkstyle//DTD Checkstyle Configuration 1.2//EN" + "https://checkstyle.org/dtds/configuration_1_2.dtd"> <!-- Checkstyle configuration for Commons FileUpload. FileUpload uses the Sun @@ -74,11 +74,6 @@ <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <module name="Translation"/> - <!-- Following interprets the header file as regular expressions. --> - <!-- <module name="RegexpHeader"/> --> - <module name="RegexpHeader"> - <property name="headerFile" value="${checkstyle.header.file}"/> - </module> <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> @@ -90,28 +85,42 @@ <!-- Require package Javadoc --> <module name="JavadocPackage"/> - <!-- Allow comments to suppress checks --> - <module name="SuppressionCommentFilter"/> - <module name="SuppressWithNearbyCommentFilter"> - <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+) FOR NEXT (\d+) LINES?"/> - <property name="checkFormat" value="$1"/> - <property name="influenceFormat" value="$2"/> + <property name="cacheFile" value="${checkstyle.cache.file}"/> + + <!-- Begin Custom for FileUpload --> + <module name="LineLength"> + <property name="max" value="120"/> + <property name="ignorePattern" value="^ \* @version .*$"/> </module> <module name="TreeWalker"> - <property name="cacheFile" value="${checkstyle.cache.file}"/> + <!-- Not fixed in 1.x branch + <module name="FinalLocalVariable"> + <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/> + <property name="validateEnhancedForLoopVariable" value="true"/> + </module> + --> <!-- Allow comments to suppress checks --> - <module name="FileContentsHolder"/> + <module name="SuppressionCommentFilter"/> + + <module name="SuppressWithNearbyCommentFilter"> + <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+) FOR NEXT (\d+) LINES?"/> + <property name="checkFormat" value="$1"/> + <property name="influenceFormat" value="$2"/> + </module> + + + + <!-- Allow comments to suppress checks + <module name="FileContentsHolder"/>--> <!-- Checks for Javadoc comments. --> <!-- See http://checkstyle.sf.net/config_javadoc.html --> <module name="JavadocMethod"> - <property name="scope" value="protected"/> - <property name="allowUndeclaredRTE" value="true"/> - <property name="allowThrowsTagsForSubclasses" value="true"/> + <property name="accessModifiers" value="protected"/> </module> <module name="JavadocType"/> <module name="JavadocVariable"/> @@ -153,11 +162,6 @@ <module name="RedundantImport"/> <module name="UnusedImports"/> - <!-- Begin Custom for FileUpload --> - <module name="LineLength"> - <property name="max" value="120"/> - <property name="ignorePattern" value="^ \* @version .*$"/> - </module> <!-- End Custom for FileUpload --> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -197,7 +201,6 @@ <!-- Checks for common coding problems --> <!-- See http://checkstyle.sf.net/config_coding.html --> - <module name="AvoidInlineConditionals"/> <module name="EmptyStatement"/> <module name="EqualsHashCode"/> <!-- Disabled for FileUpload: module name="HiddenField"/ --> @@ -205,9 +208,6 @@ <module name="InnerAssignment"/> <module name="MagicNumber"/> <module name="MissingSwitchDefault"/> - <module name="RedundantThrows"> - <property name="allowSubclasses" value="true"/> - </module> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/>
