Skip to content

Commit 6b076a9

Browse files
nbozicnsmgobec
authored andcommitted
Adding checkstyle, fixing pom and fixing checkstyle issues. (#18)
* Adding checkstyle, fixing pom and fixing checkstyle issues. * Adding java version to git ignore. * Removing java version.
1 parent 6173844 commit 6b076a9

25 files changed

+889
-227
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
*.classpath
1515
*.project
1616
target/
17+
*.java-version
1718

1819
## Scala
1920
**/.idea
2021

2122
## Intellij
22-
*.iml
23+
*.iml

checkstyle-suppressions.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE suppressions PUBLIC
4+
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
5+
"suppressions_1_1.dtd">
6+
7+
<suppressions>
8+
<!-- Exclude JavaDoc for tests -->
9+
<suppress files="[\\/]src[\\/]test[\\/].*" checks="JavadocMethod" />
10+
<suppress files="[\\/]src[\\/]test[\\/].*" checks="JavadocVariable" />
11+
<suppress files="[\\/]src[\\/]test[\\/].*" checks="JavadocType" />
12+
13+
<!-- Exclude JavaDoc for integration tests -->
14+
<suppress files="[\\/]src[\\/]integration-test[\\/].*" checks="JavadocMethod" />
15+
<suppress files="[\\/]src[\\/]integration-test[\\/].*" checks="JavadocVariable" />
16+
<suppress files="[\\/]src[\\/]integration-test[\\/].*" checks="JavadocType" />
17+
18+
<!-- Allow underscores in method names for tests -->
19+
<suppress files="[\\/]src[\\/]test[\\/].*" id="MethodNameRegular" />
20+
<suppress files="[\\/]src[\\/]integration-test[\\/].*" id="MethodNameRegular" />
21+
22+
<!-- Prevent underscores in method names for production code -->
23+
<suppress files="[\\/]src[\\/]main[\\/].*" id="MethodNameTest" />
24+
</suppressions>

checkstyle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
suppression_file=checkstyle-suppressions.xml

checkstyle.xml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
5+
<module name="Checker">
6+
7+
<module name="SuppressionFilter">
8+
<property name="file" value="${suppression_file}"/>
9+
</module>
10+
11+
<module name="NewlineAtEndOfFile">
12+
<property name="lineSeparator" value="lf"/>
13+
</module>
14+
15+
<module name="FileTabCharacter"/>
16+
17+
<module name="RegexpSingleline">
18+
<property name="format" value="\s+$"/>
19+
<property name="minimum" value="0"/>
20+
<property name="maximum" value="0"/>
21+
<property name="message" value="Line has trailing spaces."/>
22+
</module>
23+
24+
<module name="TreeWalker">
25+
26+
<module name="JavadocMethod">
27+
<property name="scope" value="protected"/>
28+
</module>
29+
30+
<module name="JavadocType"/>
31+
<module name="JavadocVariable">
32+
<property name="scope" value="protected"/>
33+
</module>
34+
<module name="JavadocStyle"/>
35+
36+
<module name="TodoComment"/>
37+
38+
<module name="ConstantName">
39+
<property name="format" value="^log(ger)?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
40+
</module>
41+
<module name="LocalFinalVariableName"/>
42+
<module name="LocalVariableName"/>
43+
<module name="MemberName"/>
44+
<module name="MethodName">
45+
<property name="id" value="MethodNameRegular"/>
46+
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
47+
</module>
48+
<module name="MethodName">
49+
<property name="id" value="MethodNameTest"/>
50+
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
51+
</module>
52+
<module name="PackageName"/>
53+
<module name="ParameterName"/>
54+
<module name="StaticVariableName"/>
55+
<module name="TypeName"/>
56+
57+
<module name="IllegalImport"/>
58+
<module name="RedundantImport"/>
59+
<module name="UnusedImports"/>
60+
61+
<module name="EmptyForIteratorPad"/>
62+
<module name="GenericWhitespace"/>
63+
<module name="MethodParamPad"/>
64+
<module name="ParenPad"/>
65+
<module name="TypecastParenPad"/>
66+
<module name="WhitespaceAfter"/>
67+
<module name="WhitespaceAround">
68+
<!-- The RCURLY token has strange semantics where annotation arrays should have a spacing while normal
69+
arrays should not have such a spacing - therefore, we rather exclude it from automatic checks -->
70+
<property name="tokens"
71+
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
72+
</module>
73+
<module name="NoWhitespaceAfter"/>
74+
<module name="NoWhitespaceBefore"/>
75+
76+
<module name="ModifierOrder"/>
77+
78+
<module name="LeftCurly"/>
79+
<module name="RightCurly"/>
80+
81+
<module name="EmptyStatement"/>
82+
<module name="EqualsHashCode"/>
83+
<module name="IllegalInstantiation"/>
84+
<module name="SimplifyBooleanExpression"/>
85+
<module name="SimplifyBooleanReturn"/>
86+
87+
<module name="HideUtilityClassConstructor"/>
88+
89+
<module name="ArrayTypeStyle"/>
90+
<module name="UpperEll"/>
91+
92+
<module name="LineLength">
93+
<property name="max" value="120"/>
94+
</module>
95+
96+
</module>
97+
</module>

0 commit comments

Comments
 (0)