You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/24 02:14:58 UTC

svn commit: r1697284 - in /commons/proper/net/trunk: checkstyle.xml pom.xml

Author: sebb
Date: Mon Aug 24 00:14:58 2015
New Revision: 1697284

URL: http://svn.apache.org/r1697284
Log:
Checkstyle fixes

Modified:
    commons/proper/net/trunk/checkstyle.xml
    commons/proper/net/trunk/pom.xml

Modified: commons/proper/net/trunk/checkstyle.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/checkstyle.xml?rev=1697284&r1=1697283&r2=1697284&view=diff
==============================================================================
--- commons/proper/net/trunk/checkstyle.xml (original)
+++ commons/proper/net/trunk/checkstyle.xml Mon Aug 24 00:14:58 2015
@@ -27,31 +27,96 @@ limitations under the License.
   <module name="JavadocPackage">
     <!-- setting allowLegacy means it will check for package.html instead of just package-info.java -->
     <property name="allowLegacy" value="true"/>
+    <property name="severity" value="warning" />
   </module>
+
   <module name="FileTabCharacter">
     <property name="fileExtensions" value="java,xml"/>
   </module>
+
+  <!-- Checks for white space at the end of the line -->
+  <!-- See http://checkstyle.sourceforge.net/config_regexp.html -->
+  <module name="RegexpSingleline">
+    <property name="format" value="\s+$" />
+    <property name="message" value="Line has trailing spaces." />
+    <property name="fileExtensions" value="java" />
+    <property name="severity" value="warning" />
+  </module>
+
+  <module name="RegexpSingleline">
+    <property name="format" value="^\s+$" />
+    <property name="message" value="Line only spaces." />
+    <property name="fileExtensions" value="java" />
+    <property name="severity" value="warning" />
+  </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 name="TreeWalker">
     <property name="cacheFile" value="target/cachefile"/>
-    <module name="AvoidStarImport"/>
+    <module name="AvoidStarImport">
+      <property name="excludes" value="org.junit.Assert"/>
+    </module>
     <module name="RedundantImport"/>
     <module name="UnusedImports"/>
     <module name="NeedBraces"/>
+    <module name="LineLength">
+      <property name="max" value="300"/> <!-- TODO reduce -->
+      <property name="severity" value="warning" />
+    </module>
+
+    <!-- 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"/-->
+    <module name="EmptyBlock">
+      <property name="option" value="text"/>
+    </module>
+
     <!-- TEMP
     <module name="RedundantThrows">
       <property name="allowUnchecked" value="true"/>
     </module>
      -->
- <!--
+
     <module name="JavadocMethod">
       <property name="scope" value="public"/>
       <property name="allowUndeclaredRTE" value="true"/>
       <property name="allowMissingJavadoc" value="true"/>
       <property name="allowMissingParamTags" value="true"/>
       <property name="allowMissingThrowsTags" value="true"/>
+      <property name="severity" value="warning" />
     </module>
- -->
- </module>
+ 
+  </module>
+
+  <module name="SuppressionCommentFilter"/>
+
+  <module name="SuppressionFilter">
+    <!-- config_loc is used by Eclipse plugin -->
+    <property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
+  </module>
+
+  <!-- 
+      Allow comment to suppress checkstyle for a single line
+      e.g. // CHECKSTYLE IGNORE MagicNumber
+   -->
+  <module name="SuppressWithNearbyCommentFilter">
+    <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+)"/>
+    <property name="checkFormat" value="$1"/>
+  </module>
+
 </module>
 
 

Modified: commons/proper/net/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/pom.xml?rev=1697284&r1=1697283&r2=1697284&view=diff
==============================================================================
--- commons/proper/net/trunk/pom.xml (original)
+++ commons/proper/net/trunk/pom.xml Mon Aug 24 00:14:58 2015
@@ -150,6 +150,7 @@ Supported protocols include: Echo, Finge
         <commons.release.2.desc>(Requires Java 1.3 or later)</commons.release.2.desc>
         <commons.jira.id>NET</commons.jira.id>
         <commons.jira.pid>12310487</commons.jira.pid>
+        <checkstyle.plugin.version>2.16</checkstyle.plugin.version>
         <commons.changes.onlyCurrentVersion>true</commons.changes.onlyCurrentVersion>
     </properties>
 
@@ -379,6 +380,20 @@ Supported protocols include: Echo, Finge
           <mainClass>examples.Main</mainClass>
         </configuration>
       </plugin>
+
+            <!-- Allow checkstyle use from command line -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <version>${checkstyle.plugin.version}</version>
+                <configuration>
+                    <configLocation>${basedir}/checkstyle.xml</configLocation>
+                    <!-- Needed to define config_loc for use by Eclipse -->
+                    <propertyExpansion>config_loc=${basedir}</propertyExpansion>
+                    <suppressionsLocation>${basedir}/checkstyle-suppressions.xml</suppressionsLocation>
+                    <enableRulesSummary>false</enableRulesSummary>
+                </configuration>
+            </plugin>
         </plugins>
 
     </build>
@@ -416,9 +431,11 @@ Supported protocols include: Echo, Finge
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>2.12.1</version>
+                <version>${checkstyle.plugin.version}</version>
                 <configuration>
                     <configLocation>${basedir}/checkstyle.xml</configLocation>
+                    <!-- Needed to define config_loc for use by Eclipse -->
+                    <propertyExpansion>config_loc=${basedir}</propertyExpansion>
                     <suppressionsLocation>${basedir}/checkstyle-suppressions.xml</suppressionsLocation>
                     <enableRulesSummary>false</enableRulesSummary>
                 </configuration>