Skip to content

Commit

Permalink
Pick up checkstyle settings from master
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed May 20, 2024
1 parent 44b6c13 commit 496bca4
Show file tree
Hide file tree
Showing 31 changed files with 255 additions and 263 deletions.
6 changes: 3 additions & 3 deletions src/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//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
Expand All @@ -18,6 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress checks="[a-zA-Z0-9]*" files=".+\.properties" />
</suppressions>
320 changes: 161 additions & 159 deletions src/checkstyle/fileupload_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
"https://checkstyle.org/dtds/configuration_1_2.dtd">

"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration for Commons FileUpload. FileUpload uses the Sun
coding guidelines, so this file is almost the same as Maven's sun_checks.xml
Expand Down Expand Up @@ -63,174 +61,178 @@
Finally, it is worth reading the documentation.
-->

<module name="Checker">

<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile" />

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation" />

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength" />

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<!-- No tabs allowed! -->
<module name="FileTabCharacter" />

<!-- No tabs allowed! -->
<module name="FileTabCharacter"/>
<!-- Require package Javadoc -->
<module name="JavadocPackage" />

<!-- Require package Javadoc -->
<module name="JavadocPackage"/>
<property name="cacheFile" value="${checkstyle.cache.file}" />

<!-- Begin Custom for FileUpload -->
<module name="LineLength">
<property name="max" value="160" />
<property name="ignorePattern" value="^ \* @version .*$" />
</module>

<property name="cacheFile" value="${checkstyle.cache.file}"/>
<module name="TreeWalker">

<!-- Begin Custom for FileUpload -->
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^ \* @version .*$"/>
<module name="ExplicitInitializationCheck" />

<module name="FinalLocalVariable">
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF" />
<property name="validateEnhancedForLoopVariable" value="true" />
</module>

<!-- 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" />
</module>

<module name="TreeWalker">

<!-- 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="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="accessModifiers" value="protected"/>
</module>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>


<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>


<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- </module> -->

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<!-- End Custom for FileUpload -->
<module name="MethodLength"/>
<module name="ParameterNumber"/>


<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>

<module name="GenericWhitespace"/>

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>


<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<!-- Begin Custom for FileUpload -->
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<!-- End Custom for FileUpload -->
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<!-- Disabled for FileUpload: module name="HiddenField"/ -->
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- Disabled for FileUpload: module name="DesignForExtension"/ -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>


<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<!-- Disabled for FileUpload: module name="FinalParameters"/ -->
<module name="RegexpSinglelineJava">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="TodoComment"/>
<module name="UpperEll"/>
<!-- 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="accessModifiers" value="protected" />
</module>
<module name="JavadocType" />
<module name="JavadocVariable" />
<module name="JavadocStyle" />


<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="PackageName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="TypeName" />

<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- </module> -->

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport" />
<module name="IllegalImport" /> <!-- defaults to sun.* packages -->
<module name="RedundantImport" />
<module name="UnusedImports" />

<!-- End Custom for FileUpload -->
<module name="MethodLength" />
<module name="ParameterNumber">
<property name="max" value="8" />
<property name="tokens" value="CTOR_DEF" />
</module>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad" />
<module name="NoWhitespaceBefore" />
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround" />

<module name="GenericWhitespace" />

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder" />
<module name="RedundantModifier" />

<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks" />
<!-- Begin Custom for FileUpload -->
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
<!-- End Custom for FileUpload -->
<module name="LeftCurly" />
<module name="NeedBraces" />
<module name="RightCurly" />


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<!-- Disabled for FileUpload: module name="HiddenField"/ -->
<module name="IllegalInstantiation" />
<module name="InnerAssignment" />
<module name="MagicNumber" />
<module name="MissingSwitchDefault" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- Disabled for FileUpload: module name="DesignForExtension"/ -->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="InterfaceIsType" />
<module name="VisibilityModifier" />

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle" />
<!-- Disabled for FileUpload: module name="FinalParameters"/ -->
<module name="RegexpSinglelineJava">
<property name="format" value="\s+$" />
<property name="message" value="Line has trailing spaces." />
</module>
<module name="TodoComment" />
<module name="UpperEll" />
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,org"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>

</module>
<!-- @author tags are deprecated -->
<module name="RegexpSingleline">
<property name="format" value="^\s+\*\s+@author\s" />
<property name="message" value="Deprecated @author tag" />
<property name="fileExtensions" value="java" />
<property name="severity" value="warning" />
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.commons.fileupload;

import java.io.File;

import org.apache.commons.fileupload.disk.DiskFileItem;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.commons.fileupload;

import java.io.File;

import org.apache.commons.fileupload.disk.DiskFileItemFactory;

/**
Expand Down Expand Up @@ -51,7 +52,6 @@ public class DefaultFileItemFactory extends DiskFileItemFactory {
*/
@Deprecated
public DefaultFileItemFactory() {
super();
}

/**
Expand Down
Loading

0 comments on commit 496bca4

Please sign in to comment.