diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-11-30 10:55:26 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-11-30 14:10:37 +0400 |
commit | 3243252e10fd86b2ba845d287e3ef0058955385f (patch) | |
tree | 9bd81b5ee8a58c31f811637ea4b6a846f3a92824 /plugins | |
parent | 39768a567bdf6e52316e51c665cfead5a7128c25 (diff) | |
download | sonarqube-3243252e10fd86b2ba845d287e3ef0058955385f.tar.gz sonarqube-3243252e10fd86b2ba845d287e3ef0058955385f.zip |
SONAR-1836 Upgrade to Checkstyle 5.5
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
Diffstat (limited to 'plugins')
10 files changed, 118 insertions, 86 deletions
diff --git a/plugins/sonar-checkstyle-plugin/pom.xml b/plugins/sonar-checkstyle-plugin/pom.xml index fafb431f097..1d94817ee37 100644 --- a/plugins/sonar-checkstyle-plugin/pom.xml +++ b/plugins/sonar-checkstyle-plugin/pom.xml @@ -14,24 +14,9 @@ <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> @@ -68,6 +53,11 @@ <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> @@ -106,20 +96,6 @@ </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> <configuration> diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml index 4f9030f57f5..af6e0f68cae 100644 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml +++ b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml @@ -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> @@ -278,17 +280,12 @@ <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> @@ -339,9 +336,13 @@ <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"> @@ -424,7 +425,9 @@ <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> @@ -634,9 +637,9 @@ <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"> @@ -933,12 +936,15 @@ <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"> @@ -1177,7 +1183,7 @@ <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"> @@ -1239,9 +1245,7 @@ <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"> @@ -1519,7 +1523,9 @@ <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> @@ -1589,4 +1595,52 @@ </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> diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties index 5cdc9f05372..b0649649483 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties @@ -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 index 00000000000..fb9b208d998 --- /dev/null +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html @@ -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 index 00000000000..7abe9d48343 --- /dev/null +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html @@ -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 index 00000000000..765dbe7815e --- /dev/null +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html @@ -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 index 00000000000..4fb3a32525d --- /dev/null +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html @@ -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 index 00000000000..dc9d4c70807 --- /dev/null +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html @@ -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. diff --git a/plugins/sonar-squid-java-plugin/pom.xml b/plugins/sonar-squid-java-plugin/pom.xml index 03548eb8a63..28282882569 100644 --- a/plugins/sonar-squid-java-plugin/pom.xml +++ b/plugins/sonar-squid-java-plugin/pom.xml @@ -13,21 +13,6 @@ <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> @@ -73,6 +58,11 @@ <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> @@ -101,20 +91,6 @@ <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> <configuration> diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/CheckstyleSquidBridge.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/CheckstyleSquidBridge.java index 9de6058b3b6..e898d4e6606 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/CheckstyleSquidBridge.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/CheckstyleSquidBridge.java @@ -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); } } |