]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1836 Upgrade to Checkstyle 5.5
authorEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 30 Nov 2011 06:55:26 +0000 (10:55 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 30 Nov 2011 10:10:37 +0000 (14:10 +0400)
New rules in 5.2:
* InnerTypeLast

Modified rules in 5.2:
* DeclarationOrder
* ImportOrder

New rules in 5.3:
* OuterTypeFilename
* NestedForDepth
* MethodCount
* OneStatementPerLine

Modified rules in 5.3:
* PackageDeclaration
* MagicNumber
* AbstractClassName
* AvoidStarImport

Modified rules in 5.4:
* UnusedImports
* MagicNumber
* EqualsAvoidNull
* IllegalThrows
* RedundantModifier

plugins/sonar-checkstyle-plugin/pom.xml
plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html [new file with mode: 0644]
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html [new file with mode: 0644]
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html [new file with mode: 0644]
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html [new file with mode: 0644]
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html [new file with mode: 0644]
plugins/sonar-squid-java-plugin/pom.xml
plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/CheckstyleSquidBridge.java

index fafb431f0976c80f117b65a77f09ac9c92267428..1d94817ee3775a32d79cbed0c79d7fa47b312f6d 100644 (file)
   <description>Checkstyle is a code analyser to help programmers write Java code that adheres to a coding standard.</description>
 
   <properties>
-    <checkstyle.version>5.1.2</checkstyle.version>
+    <checkstyle.version>5.5</checkstyle.version>
   </properties>
 
-  <repositories>
-    <!-- for checkstyle 5.1.x -->
-    <repository>
-      <id>sonar</id>
-      <name>Sonar</name>
-      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
   <dependencies>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
@@ -39,8 +24,8 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>com.sonarsource.checkstyle</groupId>
-      <artifactId>checkstyle-java7</artifactId>
+      <groupId>com.puppycrawl.tools</groupId>
+      <artifactId>checkstyle</artifactId>
       <version>${checkstyle.version}</version>
       <exclusions>
         <exclusion>
           <groupId>commons-beanutils</groupId>
           <artifactId>commons-beanutils-core</artifactId>
         </exclusion>
+        <exclusion>
+          <!-- Checkstyle 5.5 declares this dependency, whereas 5.1 not -->
+          <groupId>com.sun</groupId>
+          <artifactId>tools</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
       </testResource>
     </testResources>
     <plugins>
-      <plugin>
-        <!-- TODO remove (see SONAR-2938) -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-no-repositories</id>
-            <configuration>
-              <skip>true</skip>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
       <plugin>
         <groupId>org.codehaus.sonar</groupId>
         <artifactId>sonar-packaging-maven-plugin</artifactId>
index 4f9030f57f595ed5d6dd11fc7a946a00ff49c3ed..af6e0f68caeff65e5127fa913b86779d245968ae 100644 (file)
@@ -93,7 +93,9 @@
     <name><![CDATA[Equals Avoid Null]]></name>
     <configKey><![CDATA[Checker/TreeWalker/EqualsAvoidNull]]></configKey>
 
-
+    <param key="ignoreEqualsIgnoreCase" type="b">
+      <defaultValue>false</defaultValue>
+    </param>
   </rule>
 
 
     <param key="format" type="r">
       <defaultValue>^Abstract.*$|^.*Factory$</defaultValue>
     </param>
-    <!--
-    Not supported yet
     <param key="ignoreModifier" type="b">
-      
       <defaultValue>false</defaultValue>
     </param>
     <param key="ignoreName" type="b">
-      
       <defaultValue>false</defaultValue>
     </param>
-    -->
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck">
     <priority>MAJOR</priority>
     <name><![CDATA[Avoid Star Import]]></name>
     <configKey><![CDATA[Checker/TreeWalker/AvoidStarImport]]></configKey>
 
-
     <param key="excludes" type="s{}">
-
+    </param>
+    <param key="allowClassImports" type="b">
+      <defaultValue>false</defaultValue>
+    </param>
+    <param key="allowStaticMemberImports" type="b">
+      <defaultValue>false</defaultValue>
     </param>
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck">
     <name><![CDATA[Declaration Order]]></name>
     <configKey><![CDATA[Checker/TreeWalker/DeclarationOrder]]></configKey>
 
-
+    <param key="ignoreConstructors" type="b" />
+    <param key="ignoreMethods" type="b" />
+    <param key="ignoreModifiers" type="b" />
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck">
     <priority>MAJOR</priority>
     <name><![CDATA[Illegal Throws]]></name>
     <configKey><![CDATA[Checker/TreeWalker/IllegalThrows]]></configKey>
 
-
     <param key="illegalClassNames" type="s{}">
-
+    </param>
+    <param key="ignoredMethodNames" type="s{}">
     </param>
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck">
     <name><![CDATA[Magic Number]]></name>
     <configKey><![CDATA[Checker/TreeWalker/MagicNumber]]></configKey>
 
-
     <param key="tokens" type="s[NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG]">
-
     </param>
     <param key="ignoreNumbers" type="i{}">
-
+    </param>
+    <param key="ignoreHashCodeMethod" type="b">
+      <defaultValue>false</defaultValue>
+    </param>
+    <param key="ignoreAnnotation" type="b">
+      <defaultValue>false</defaultValue>
     </param>
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck">
     <name><![CDATA[Package Declaration]]></name>
     <configKey><![CDATA[Checker/TreeWalker/PackageDeclaration]]></configKey>
 
-
+    <param key="ignoreDirectoryName" type="b" />
   </rule>
 
   <rule key="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
     <name><![CDATA[Redundant Modifier]]></name>
     <configKey><![CDATA[Checker/TreeWalker/RedundantModifier]]></configKey>
 
-
-    <param key="tokens" type="s[METHOD_DEF,VARIABLE_DEF,ANNOTATION_FIELD_DEF]">
-
+    <param key="tokens" type="s[METHOD_DEF,VARIABLE_DEF,ANNOTATION_FIELD_DEF,INTERFACE_DEF]">
     </param>
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck">
     <name><![CDATA[Unused Imports]]></name>
     <configKey><![CDATA[Checker/TreeWalker/UnusedImports]]></configKey>
 
-
+    <param key="processJavadoc" type="b">
+      <defaultValue>false</defaultValue>
+    </param>
   </rule>
   <rule key="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck">
     <priority>MINOR</priority>
 
     </param>
   </rule>
-</rules>
\ No newline at end of file
+
+  <rule key="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck">
+    <priority>INFO</priority>
+    <name><![CDATA[Inner Type Last]]></name>
+    <configKey><![CDATA[Checker/TreeWalker/InnerTypeLast]]></configKey>
+  </rule>
+
+  <rule key="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck">
+    <priority>MAJOR</priority>
+    <name><![CDATA[Outer Type Filename]]></name>
+    <configKey><![CDATA[Checker/TreeWalker/OuterTypeFilename]]></configKey>
+  </rule>
+
+  <rule key="com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck">
+    <priority>MAJOR</priority>
+    <name><![CDATA[Nested For Depth]]></name>
+    <configKey><![CDATA[Checker/TreeWalker/NestedForDepth]]></configKey>
+    <param key="max" type="i">
+      <defaultValue>1</defaultValue>
+    </param>
+  </rule>
+
+  <rule key="com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck">
+    <priority>MAJOR</priority>
+    <name><![CDATA[Method Count]]></name>
+    <configKey><![CDATA[Checker/TreeWalker/MethodCount]]></configKey>
+    <param key="maxTotal" type="i">
+      <defaultValue>100</defaultValue>
+    </param>
+    <param key="maxPrivate" type="i">
+      <defaultValue>100</defaultValue>
+    </param>
+    <param key="maxPackage" type="i">
+      <defaultValue>100</defaultValue>
+    </param>
+    <param key="maxProtected" type="i">
+      <defaultValue>100</defaultValue>
+    </param>
+    <param key="maxPublic" type="i">
+      <defaultValue>100</defaultValue>
+    </param>
+  </rule>
+
+  <rule key="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck">
+    <priority>MAJOR</priority>
+    <name><![CDATA[One Statement Per Line]]></name>
+    <configKey><![CDATA[Checker/TreeWalker/OneStatementPerLine]]></configKey>
+  </rule>
+</rules>
index 5cdc9f05372b7f7b3b4298609cb5b15330d189aa..b064964948372017f04145371531b63bde665878 100644 (file)
@@ -1,6 +1,7 @@
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.name=Missing Override
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.param.javaFiveCompatibility=When this property is true this check will only check classes, interfaces, etc. that do not contain the extends or implements keyword or are not anonymous classes. This means it only checks methods overridden from java.lang.Object  Java 5 Compatibility mode severely limits this check. It is recommended to only use it on Java 5 source.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.name=Equals Avoid Null
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.param.ignoreEqualsIgnoreCase=whether to ignore String.equalsIgnoreCase() invocations. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.name=Javadoc Package
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.param.allowLegacy=If set then allow the use of a package.html file.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck.name=Declaration Order
@@ -24,8 +25,11 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberChec
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck.name=Design For Extension
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.name=Illegal Throws
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.param.illegalClassNames=throw class names to reject
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.param.ignoredMethodNames=names of methods to ignore. Default is "finalize".
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.name=Avoid Star Import
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.excludes=packages where star imports are allowed. Note that this property is not recursive, subpackages of excluded packages are not automatically excluded.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.allowClassImports=whether to allow starred class imports like <code>import java.util.*;</code>. Default is false.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.allowStaticMemberImports=whether to allow starred static member imports like <code>import static org.junit.Assert.*;</code>. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.name=Illegal Catch
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.param.illegalClassNames=exception class names to reject
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.name=Typecast Paren Pad
@@ -96,6 +100,8 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVar
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.name=Magic Number
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.tokens=tokens to check
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreNumbers=non-magic numbers. Default is -1,0,1,2.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreHashCodeMethod=ignore magic numbers in hashCode methods. Default is false.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreAnnotation=ignore magic numbers in annotation declarations. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.name=Header
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.param.header=the required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator)
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.param.ignoreLines=comma-separated list of line numbers to ignore
@@ -130,6 +136,7 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineChe
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.name=File Tab Character
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.param.eachLine=whether to report on each line containing a tab, or just the first instance. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.name=Unused Imports
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.param.processJavadoc=whether to process Javadoc. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck.name=Simplify Boolean Expression
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.name=Uncommented Main
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.param.excludedClasses=pattern for qualified names of classes which are allowed to have a main method.
@@ -233,8 +240,11 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksC
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.name=Need Braces
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.param.tokens=blocks to check
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.name=Abstract Class Name
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.param.ignoreModifier=Controls whether to ignore checking for the abstract modifier on classes that match the name. Default is false.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.param.ignoreName=Controls whether to ignore checking the name. Realistically only useful if using the check to identify that match name and do not have the abstract modifier name. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.name=Missing Constructor
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.name=Package Declaration
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.param.ignoreDirectoryName=whether to ignore checking that the package declaration matches the source directory name. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.name=JavaNCSS
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.param.classMaximum=the maximum allowed number of non commenting lines in a class. Default is 1500.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.param.methodMaximum=the maximum allowed number of non commenting lines in a method. Default is 50.
@@ -274,7 +284,7 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicat
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.name=Import Order
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.separated=whether imports groups should be separated by, at least, one blank line. Default is false.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.caseSensitive=whether string comparision should be case sensitive or not. Default is true.
-rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.groups=list of imports groups (every group identified by string it's started)
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.groups=list of imports groups (every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. /regexp/)
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.option=policy on the relative order between regular imports and static imports. Values are top, above, inflow, under, bottom. See examples: http://checkstyle.sourceforge.net/property_types.html#importOrder
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.ordered=whether imports within group should be sorted. Default is true.
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.name=Whitespace Around
@@ -314,3 +324,14 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsChe
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck.name=Array Trailing Comma
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.name=Generic Whitespace
 rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.name=No Clone
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.name=Inner Type Last
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.name=Outer Type Filename
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.name=Nested For Depth
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.param.max=allowed nesting depth.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.name=Method Count
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxTotal=maximum allowable number of methods at all scope levels.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPrivate=maximum allowable number of private methods.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPackage=maximum allowable number of package methods.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxProtected=maximum allowable number of protected methods.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPublic=maximum allowable number of public methods.
+rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.name=One Statement Per Line
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html
new file mode 100644 (file)
index 0000000..fb9b208
--- /dev/null
@@ -0,0 +1 @@
+Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java.
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html
new file mode 100644 (file)
index 0000000..7abe9d4
--- /dev/null
@@ -0,0 +1 @@
+Restricts nested for blocks to a specified depth.
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html
new file mode 100644 (file)
index 0000000..765dbe7
--- /dev/null
@@ -0,0 +1 @@
+Checks there is only one statement per line. The following line will be flagged as an error: <code>x = 1; y = 2; // Two statments on a single line.</code>
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html
new file mode 100644 (file)
index 0000000..4fb3a32
--- /dev/null
@@ -0,0 +1 @@
+Check nested (internal) classes/interfaces are declared at the bottom of the class after all method and field declarations.
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html
new file mode 100644 (file)
index 0000000..dc9d4c7
--- /dev/null
@@ -0,0 +1 @@
+Checks the number of methods declared in each type. This includes the number of each scope (private, package, protected and public) as well as an overall total.
index 03548eb8a63b422d88b88873dd9666672c8b6841..282828825697c42b31f70b48b79f456e2693a630 100644 (file)
   <name>Sonar :: Plugins :: Squid Java</name>
   <description>Squid analyzer for Java.</description>
 
-  <repositories>
-    <!-- for checkstyle 5.1.x -->
-    <repository>
-      <id>sonar</id>
-      <name>Sonar</name>
-      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
   <dependencies>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
@@ -55,9 +40,9 @@
       <version>3.2</version>
     </dependency>
     <dependency>
-      <groupId>com.sonarsource.checkstyle</groupId>
-      <artifactId>checkstyle-java7</artifactId>
-      <version>5.1.2</version>
+      <groupId>com.puppycrawl.tools</groupId>
+      <artifactId>checkstyle</artifactId>
+      <version>5.5</version>
       <exclusions>
         <exclusion>
           <groupId>commons-logging</groupId>
           <groupId>commons-beanutils</groupId>
           <artifactId>commons-beanutils-core</artifactId>
         </exclusion>
+        <exclusion>
+          <!-- Checkstyle 5.5 declares this dependency, whereas 5.1 not -->
+          <groupId>com.sun</groupId>
+          <artifactId>tools</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
 
   <build>
     <plugins>
-      <plugin>
-        <!-- TODO remove (see SONAR-2938) -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-no-repositories</id>
-            <configuration>
-              <skip>true</skip>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
       <plugin>
         <groupId>org.codehaus.sonar</groupId>
         <artifactId>sonar-packaging-maven-plugin</artifactId>
index 9de6058b3b6653d36fc6ac826f5bd710d550321f..e898d4e6606815698a64a8aff32a4fb1d49c30ae 100644 (file)
@@ -72,7 +72,7 @@ public class CheckstyleSquidBridge extends Check {
   public static void setInputFiles(Collection<InputFile> inputFiles) {
     inputFilesByPath.clear();
     for (InputFile inputFile : inputFiles) {
-      inputFilesByPath.put(inputFile.getFile(), inputFile);
+      inputFilesByPath.put(inputFile.getFile().getAbsoluteFile(), inputFile);
     }
   }