Skip to content

Commit 903d97f

Browse files
committed
Issue #156: upgrade to checkstyle 8.12
1 parent 8cc1f66 commit 903d97f

File tree

6 files changed

+68
-6
lines changed

6 files changed

+68
-6
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,19 @@
565565
<txt>min</txt>
566566
</prop>
567567
</chc>
568+
<chc>
569+
<rule-repo>checkstyle</rule-repo>
570+
<rule-key>com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck</rule-key>
571+
<prop>
572+
<key>remediationFunction</key>
573+
<txt>CONSTANT_ISSUE</txt>
574+
</prop>
575+
<prop>
576+
<key>offset</key>
577+
<val>2</val>
578+
<txt>min</txt>
579+
</prop>
580+
</chc>
568581
<chc>
569582
<rule-repo>checkstyle</rule-repo>
570583
<rule-key>com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck</rule-key>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNam
156156
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck.param.format=Regular expression
157157
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.name=Redundant Modifier
158158
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.param.tokens=tokens to check
159+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.name=Interface Member Implied Modifier
160+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedPublicField=Control whether to enforce that public is explicitly coded on interface fields.
161+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedStaticField=Control whether to enforce that static is explicitly coded on interface fields.
162+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedFinalField=Control whether to enforce that final is explicitly coded on interface fields.
163+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedPublicMethod=Control whether to enforce that public is explicitly coded on interface methods.
164+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedAbstractMethod=Control whether to enforce that abstract is explicitly coded on interface methods.
165+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedPublicNested=Control whether to enforce that public is explicitly coded on interface nested types.
166+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck.param.violateImpliedStaticNested=Control whether to enforce that static is explicitly coded on interface nested types.
159167
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.name=Empty For Initializer Pad
160168
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.param.option=policy on how to pad an empty for iterator
161169
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.name=Javadoc Style
@@ -378,6 +386,8 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.
378386
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.ordered=whether imports within group should be sorted.
379387
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.sortStaticImportsAlphabetically=whether static imports grouped by top or bottom option are sorted alphabetically or not.
380388
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.useContainerOrderingForStatic=whether to use container ordering (Eclipse IDE term) for static imports or not. Default is false.
389+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.staticGroups=list of static import groups (every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. /regexp/).
390+
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.separatedStaticGroups=whether static import groups should be separated by, at least, one blank line or comment and are not separated internally. (This property has effect only when the property option is is set to top or bottom.)
381391
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.tokens=tokens to check
382392
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.name=Whitespace Around
383393
rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.param.tokens=tokens to check
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div >
2+
<div class="section">
3+
Checks for implicit modifiers on interface members and nested types.
4+
see full documentation at <a href="https://checkstyle.org/config_modifier.html#InterfaceMemberImpliedModifier">InterfaceMemberImpliedModifier</a>
5+
</div>
6+
</div>

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

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,17 @@
743743
<param key="caseSensitive" type="BOOLEAN">
744744
<defaultValue>true</defaultValue>
745745
</param>
746+
<param key="staticGroups" type="s{}">
747+
</param>
746748
<param key="sortStaticImportsAlphabetically" type="BOOLEAN">
747749
<defaultValue>false</defaultValue>
748750
</param>
749751
<param key="useContainerOrderingForStatic" type="BOOLEAN">
750752
<defaultValue>false</defaultValue>
751753
</param>
754+
<param key="separatedStaticGroups" type="BOOLEAN">
755+
<defaultValue>false</defaultValue>
756+
</param>
752757
<param key="tokens" type="s[STATIC_IMPORT]">
753758
<defaultValue>STATIC_IMPORT</defaultValue>
754759
</param>
@@ -943,8 +948,8 @@
943948
<defaultValue>true</defaultValue>
944949
</param>
945950
<param key="tokens"
946-
type="s[INTERFACE_DEF,CLASS_DEF,ANNOTATION_DEF,ENUM_DEF,CTOR_DEF,METHOD_DEF,ENUM_CONSTANT_DEF,LITERAL_WHILE,LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_SYNCHRONIZED,LITERAL_SWITCH,LITERAL_DO,LITERAL_IF,LITERAL_ELSE,LITERAL_FOR,STATIC_INIT,OBJBLOCK,LAMBDA]">
947-
<defaultValue>INTERFACE_DEF,CLASS_DEF,ANNOTATION_DEF,ENUM_DEF,CTOR_DEF,METHOD_DEF,ENUM_CONSTANT_DEF,LITERAL_WHILE,LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_SYNCHRONIZED,LITERAL_SWITCH,LITERAL_DO,LITERAL_IF,LITERAL_ELSE,LITERAL_FOR,STATIC_INIT,OBJBLOCK,LAMBDA</defaultValue>
951+
type="s[ANNOTATION_DEF,CLASS_DEF,CTOR_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,INTERFACE_DEF,LAMBDA,LITERAL_CASE,LITERAL_CATCH,LITERAL_DEFAULT,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF,OBJBLOCK,STATIC_INIT]">
952+
<defaultValue>ANNOTATION_DEF,CLASS_DEF,CTOR_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,INTERFACE_DEF,LAMBDA,LITERAL_CASE,LITERAL_CATCH,LITERAL_DEFAULT,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF,OBJBLOCK,STATIC_INIT</defaultValue>
948953
</param>
949954
<status>READY</status>
950955
</rule>
@@ -1858,8 +1863,8 @@
18581863
<priority>MAJOR</priority>
18591864
<configKey><![CDATA[Checker/TreeWalker/EmptyLineSeparator]]></configKey>
18601865
<cardinality>MULTIPLE</cardinality>
1861-
<param key="tokens" type="s[PACKAGE_DEF,IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF,VARIABLE_DEF]">
1862-
<defaultValue>PACKAGE_DEF,IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF,VARIABLE_DEF</defaultValue>
1866+
<param key="tokens" type="s[PACKAGE_DEF,IMPORT,STATIC_IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF,VARIABLE_DEF]">
1867+
<defaultValue>PACKAGE_DEF,IMPORT,STATIC_IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF,VARIABLE_DEF</defaultValue>
18631868
</param>
18641869
<param key="allowNoEmptyLineBetweenFields" type="BOOLEAN">
18651870
<defaultValue>false</defaultValue>
@@ -2078,4 +2083,32 @@
20782083
</param>
20792084
</rule>
20802085

2086+
<rule key="com.puppycrawl.tools.checkstyle.checks.modifier.InterfaceMemberImpliedModifierCheck">
2087+
<priority>MINOR</priority>
2088+
<name><![CDATA[Interface Member Implied Modifier]]></name>
2089+
<configKey><![CDATA[Checker/TreeWalker/InterfaceMemberImpliedModifier]]></configKey>
2090+
2091+
<param key="violateImpliedPublicField" type="BOOLEAN">
2092+
<defaultValue>true</defaultValue>
2093+
</param>
2094+
<param key="violateImpliedStaticField" type="BOOLEAN">
2095+
<defaultValue>true</defaultValue>
2096+
</param>
2097+
<param key="violateImpliedFinalField" type="BOOLEAN">
2098+
<defaultValue>true</defaultValue>
2099+
</param>
2100+
<param key="violateImpliedPublicMethod" type="BOOLEAN">
2101+
<defaultValue>true</defaultValue>
2102+
</param>
2103+
<param key="violateImpliedAbstractMethod" type="BOOLEAN">
2104+
<defaultValue>true</defaultValue>
2105+
</param>
2106+
<param key="violateImpliedPublicNested" type="BOOLEAN">
2107+
<defaultValue>true</defaultValue>
2108+
</param>
2109+
<param key="violateImpliedStaticNested" type="BOOLEAN">
2110+
<defaultValue>true</defaultValue>
2111+
</param>
2112+
</rule>
2113+
20812114
</rules>

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

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

5858
final List<RulesDefinition.Rule> rules = repository.rules();
59-
assertThat(rules).hasSize(155);
59+
assertThat(rules).hasSize(156);
6060

6161
for (RulesDefinition.Rule rule : rules) {
6262
assertThat(rule.key()).isNotNull();

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
</ciManagement>
8686

8787
<properties>
88-
<checkstyle.version>8.11</checkstyle.version>
88+
<checkstyle.version>8.12</checkstyle.version>
8989
<sonar.version>5.6.6</sonar.version>
9090
<sonar-java.version>3.7</sonar-java.version>
9191
<java.version>1.8</java.version>

0 commit comments

Comments
 (0)