Skip to content

Commit dc1e0ff

Browse files
author
Daniel Muehlbachler
committed
Issue #259: update to CS 8.28
1 parent 0cdadae commit dc1e0ff

File tree

7 files changed

+32
-17
lines changed

7 files changed

+32
-17
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Compatibility matrix from checkstyle team:
2121

2222
Checkstyle Plugin|Sonar min|Sonar max|Checkstyle|Jdk
2323
-----------------|---------|---------|----------|---
24+
4.28|7.9 |7.9+|8.28|11
2425
4.27|6.7 |7.7+|8.27|1.8
2526
4.26|6.7 |7.7+|8.26|1.8
2627
4.25|6.7 |7.7+|8.25|1.8
@@ -73,7 +74,7 @@ Jdk version depends on checkstyle's and sonar's jdk version:
7374

7475
checkstyle:6.0 use jdk6, checkstyle:6.2 use jdk7, checkstyle:7.0 use jdk8.
7576

76-
sonar:3.6 used jdk6, sonar:4.5 use jdk6, sonar:5.6-latest use jdk8.
77+
sonar:3.6 used jdk6, sonar:4.5 use jdk6, sonar:5.6-7.8 use jdk8, sonar:7.9-latest use jdk11.
7778

7879
## Usage
7980
Install it from Sonar Update Center:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
</ciManagement>
9696

9797
<properties>
98-
<checkstyle.version>8.27</checkstyle.version>
98+
<checkstyle.version>8.28</checkstyle.version>
9999
<sonar.version>7.9</sonar.version>
100100
<sonar-java.version>6.0.0.20538</sonar-java.version>
101101
<maven.checkstyle.plugin.version>3.1.0</maven.checkstyle.plugin.version>

src/main/resources/com/sonar/sqale/checkstyle-model.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,19 @@
15491549
<txt>min</txt>
15501550
</prop>
15511551
</chc>
1552+
<chc>
1553+
<rule-repo>checkstyle</rule-repo>
1554+
<rule-key>com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck</rule-key>
1555+
<prop>
1556+
<key>remediationFunction</key>
1557+
<txt>CONSTANT_ISSUE</txt>
1558+
</prop>
1559+
<prop>
1560+
<key>offset</key>
1561+
<val>20</val>
1562+
<txt>min</txt>
1563+
</prop>
1564+
</chc>
15521565
<chc>
15531566
<rule-repo>checkstyle</rule-repo>
15541567
<rule-key>com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck</rule-key>

src/main/resources/org/sonar/l10n/checkstyle.properties

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,16 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.param.
8888
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.name=Javadoc Method
8989
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.tokens=definitions to check
9090
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingReturnTag=whether to ignore errors when a method returns non-void type does have a return tag in the javadoc. Default is false.
91-
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingThrowsTags=whether to ignore errors when a method declares that it throws exceptions but does have matching throws tags in the javadoc. Default is false.
92-
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowThrowsTagsForSubclasses=whether to allow documented exceptions that are subclass of one of declared exception. Default is false.
9391
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingParamTags=whether to ignore errors when a method has parameters but does not have matching param tags in the javadoc. Default is false.
9492
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.scope=visibility scope where Javadoc comments are checked
9593
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.excludeScope=visibility scope where Javadoc comments are not checked
96-
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowUndeclaredRTE=whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException. Default is false.
9794
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowedAnnotations=List of annotations that could allow missed documentation
9895
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.validateThrows=Allows validating throws tags
9996
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocationCheck.name=Javadoc Content Location
10097
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocationCheck.param.location=Specify the policy on placement of the Javadoc content
10198
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocBlockTagLocationCheck.name=Javadoc Block Tag Location
10299
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocBlockTagLocationCheck.param.tags=Specify the javadoc tags to process.
103-
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck.name=Javadoc Method
100+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck.name=Missing Javadoc Method
104101
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck.param.tokens=definitions to check
105102
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck.param.scope=visibility scope where Javadoc comments are checked
106103
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck.param.excludeScope=visibility scope where Javadoc comments are not checked
@@ -153,6 +150,7 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.param.
153150
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck.name=Avoid Inline Conditionals
154151
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.name=Nested Try Depth
155152
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.param.max=allowed nesting depth. Default is 1.
153+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck.name=No Array Trailing Comma
156154
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.name=Trailing Comment
157155
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.param.legalComment=pattern for text of trailing comment which is allowed. (this patter will not be applied to multiline comments and text of comment will be trimmed before matching)
158156
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.param.format=pattern for string allowed before comment.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>
2+
Checks that array initialization do not contain a trailing comma.
3+
Rationale: JLS allows trailing commas in arrays and enumerations, but does not allow them in other locations.
4+
To unify the coding style, the use of trailing commas should be prohibited.
5+
</p>

src/main/resources/org/sonar/plugins/checkstyle/rules.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -841,18 +841,9 @@
841841
</param>
842842
<param key="excludeScope" type="s[nothing,public,protected,package,private,anoninner]">
843843
</param>
844-
<param key="allowUndeclaredRTE" type="BOOLEAN">
845-
<defaultValue>false</defaultValue>
846-
</param>
847-
<param key="allowThrowsTagsForSubclasses" type="BOOLEAN">
848-
<defaultValue>false</defaultValue>
849-
</param>
850844
<param key="allowMissingParamTags" type="BOOLEAN">
851845
<defaultValue>false</defaultValue>
852846
</param>
853-
<param key="allowMissingThrowsTags" type="BOOLEAN">
854-
<defaultValue>false</defaultValue>
855-
</param>
856847
<param key="allowMissingReturnTag" type="BOOLEAN">
857848
<defaultValue>false</defaultValue>
858849
</param>
@@ -1286,6 +1277,13 @@
12861277
<status>READY</status>
12871278
</rule>
12881279

1280+
<rule key="com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck">
1281+
<priority>MAJOR</priority>
1282+
<name><![CDATA[No Array Trailing Comma]]></name>
1283+
<configKey><![CDATA[Checker/TreeWalker/NoArrayTrailingComma]]></configKey>
1284+
<status>READY</status>
1285+
</rule>
1286+
12891287
<rule key="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
12901288
<priority>MINOR</priority>
12911289
<name><![CDATA[Newline At End Of File]]></name>
@@ -1490,7 +1488,7 @@
14901488
<param key="option" type="s[same,alone,alone_or_singleline]">
14911489
<defaultValue>same</defaultValue>
14921490
</param>
1493-
<param key="tokens" type="s[LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_ELSE,CLASS_DEF,METHOD_DEF,CTOR_DEF,LITERAL_FOR,LITERAL_WHILE,LITERAL_DO,STATIC_INIT,INSTANCE_INIT]">
1491+
<param key="tokens" type="s[LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_ELSE,CLASS_DEF,METHOD_DEF,CTOR_DEF,LITERAL_FOR,LITERAL_WHILE,LITERAL_DO,STATIC_INIT,INSTANCE_INIT,ANNOTATION_DEF]">
14941492
<defaultValue>LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_ELSE</defaultValue>
14951493
</param>
14961494
<status>READY</status>

src/test/java/org/sonar/plugins/checkstyle/CheckstyleRulesDefinitionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void test() {
6161
assertThat(repository.language()).isEqualTo("java");
6262

6363
final List<RulesDefinition.Rule> rules = repository.rules();
64-
assertThat(rules).hasSize(167);
64+
assertThat(rules).hasSize(168);
6565

6666
for (RulesDefinition.Rule rule : rules) {
6767
assertThat(rule.key()).isNotNull();

0 commit comments

Comments
 (0)