Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 92227dc

Browse files
committed
upgrade checkstyle to 8.37 + update rules/code
1 parent 965e5b3 commit 92227dc

File tree

95 files changed

+782
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+782
-750
lines changed

ant/build.gant

+4-16
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ target(name: 'vimdocs'){
620620

621621
target(name: 'checkstyle'){
622622
path(id: 'checkstyle-classpath'){
623-
fileset(dir: 'ant/lib/', includes: 'checkstyle-*.jar')
623+
fileset(dir: 'org.eclim.jdt/lib/', includes: 'checkstyle-*.jar')
624624
pathelement(path: '${build.classes}/checkstyle')
625625
}
626626
mkdir(dir: '${build.classes}/checkstyle')
@@ -635,30 +635,18 @@ target(name: 'checkstyle'){
635635
compilerarg(value: '-Xlint:-options')
636636
}
637637

638-
// ant may contain an antlr jar that is incompatible w/ checkstyle, but
639-
// checkstyle doesn't support forking of it's own, so we have to use the java
640-
// task to ensure that ant's antlr jar doesn't get loaded.
641-
//taskdef(resource: 'checkstyletask.properties', classpathref: 'checkstyle-classpath')
642-
//checkstyle(config: 'ant/checkstyle.xml'){
643-
// pluginNames.each(){ name ->
644-
// if (new File("${name}/java").exists()){
645-
// fileset(dir: "${name}/java",
646-
// includes: 'org/eclim/**/*.java',
647-
// excludes: 'org/eclim/util/file/BufferedReader.java')
648-
// //property(key: 'checkstyle.cache.file', file: 'build/temp/checkstyle/cache')
649-
// }
650-
// }
651-
//}
652638
java(
653639
classname: 'com.puppycrawl.tools.checkstyle.Main',
654640
classpathref: 'checkstyle-classpath'){
655641
arg(value: '-c')
656642
arg(value: "ant/checkstyle.xml")
657643
pluginNames.each(){ name ->
658644
if (new File("${name}/java").exists()){
659-
arg(value: '-r')
660645
arg(value: "${name}/java")
661646
}
647+
if (new File("${name}/test/junit").exists()){
648+
arg(value: "${name}/test/junit")
649+
}
662650
}
663651
}
664652
}

ant/checkstyle.xml

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
55

66
<module name="Checker">
77
<property name="severity" value="warning"/>
88

9-
<module name="SuppressionCommentFilter"/>
109
<module name="SuppressionFilter">
1110
<property name="file" value="ant/checkstyle-suppressions.xml"/>
1211
</module>
12+
<module name="LineLength">
13+
<property name="max" value="85"/>
14+
<property name="ignorePattern" value="^(\s*\* (@see )?[^ ]+|^import\b.*|\s*// [^ ].*)$"/>
15+
</module>
1316
<module name="FileTabCharacter"/>
17+
1418
<module name="TreeWalker">
1519
<property name="tabWidth" value="2" />
1620

17-
<module name="FileContentsHolder"/>
21+
<module name="SuppressionCommentFilter"/>
1822
<module name="ArrayTrailingComma"/>
1923
<module name="ArrayTypeStyle"/>
20-
<module name="AvoidStarImport"/>
24+
<module name="AvoidStarImport">
25+
<property name="allowStaticMemberImports" value="true"/>
26+
</module>
2127
<module name="DeclarationOrder">
2228
<property name="ignoreModifiers" value="true"/>
2329
</module>
@@ -30,12 +36,16 @@
3036
</module>
3137
<module name="EmptyStatement"/>
3238
<module name="GenericWhitespace"/>
33-
<module name="ImportOrder">
39+
<!--
40+
as of checkstyle 8.3, 'separated=true' returns warnings for any blank
41+
space on imports that have the same root package name ('java', 'org', etc)
42+
-->
43+
<!--module name="org.eclim.checkstyle.ImportOrderCheck">
3444
<property name="groups" value="/^javax?\./,org"/>
3545
<property name="ordered" value="true"/>
3646
<property name="separated" value="true"/>
3747
<property name="option" value="above"/>
38-
</module>
48+
</module-->
3949
<module name="org.eclim.checkstyle.LeftCurly">
4050
<property name="option" value="nl"/>
4151
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, CTOR_DEF, METHOD_DEF"/>
@@ -48,10 +58,6 @@
4858
LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
4959
LITERAL_TRY, LITERAL_WHILE"/>
5060
</module>
51-
<module name="LineLength">
52-
<property name="max" value="85"/>
53-
<property name="ignorePattern" value="^(\s*\* (@see )?[^ ]+|^import\b.*|\s*// [^ ].*)$"/>
54-
</module>
5561
<module name="MethodParamPad">
5662
<property name="tokens" value="METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL"/>
5763
<property name="option" value="nospace"/>
@@ -73,8 +79,8 @@
7379
<module name="RightCurly">
7480
<property name="option" value="same"/>
7581
</module>
76-
<module name="org.eclim.checkstyle.ThrowsClause"/>
77-
<module name="org.eclim.checkstyle.WhitespaceAfter">
82+
<module name="org.eclim.checkstyle.ThrowsClauseCheck"/>
83+
<module name="WhitespaceAfter">
7884
<property name="tokens" value="COMMA, SEMI"/>
7985
</module>
8086
<module name="WhitespaceAround">

0 commit comments

Comments
 (0)