forked from bytebang/vpl-junit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckstyle_base.xml
147 lines (121 loc) · 5.45 KB
/
checkstyle_base.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE module [
<!ELEMENT module (module|property|metadata|message)*>
<!ATTLIST module name NMTOKEN #REQUIRED>
<!ELEMENT property EMPTY>
<!ATTLIST property
name NMTOKEN #REQUIRED
value CDATA #REQUIRED
default CDATA #IMPLIED
>
<!ELEMENT metadata EMPTY>
<!ATTLIST metadata
name NMTOKEN #REQUIRED
value CDATA #REQUIRED
>
<!ELEMENT message EMPTY>
<!ATTLIST message
key NMTOKEN #REQUIRED
value CDATA #REQUIRED
>
]>
<module name = "Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<!-- File should be named as the class -->
<module name="OuterTypeFilename"/>
<!-- Only one class per File -->
<module name="OneTopLevelClass"/>
<!-- no lines longer than 150 chars -->
<module name="LineLength">
<property name="max" value="150"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<!-- No escaped Strings and Chars -->
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<!-- We want explicit imports -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- We do not want to have things like method declarations or imports to be line wrapped -->
<module name="NoLineWrap"/>
<!-- Empty blocks are useless -->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<!-- no Spaghetti code -->
<module name="OneStatementPerLine"/>
<!-- Switches should have a default -->
<module name="MissingSwitchDefault"/>
<!-- Fallthroughs are potentially dangerous -->
<module name="FallThrough"/>
<!-- If there is something to do -> do it ! -->
<module name="TodoComment"/>
<!-- We want to have our code structured, so we want empty lines between line separators,
after header, package, all import declarations, fields, constructors, methods,
nested classes, static initializers and instance initializers -->
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<!-- There should be a space between method parameters -->
<module name="MethodParamPad"/>
<!-- There should be no spaces between the names tokens -->
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT"/>
<property name="allowLineBreaks" value="true"/>
</module>
<!-- No passing in between parantheses -->
<module name="ParenPad">
<property name="option" value="nospace"/>
</module>
<!-- No line wrap at these tokens -->
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<!-- Empty catch blocks are trying to hide something ! -->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<!-- Generics do not need whitespaces -->
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<!-- Comments should be intended as the thing that they are commenting -->
<module name="CommentsIndentation"/>
<!-- General intendation - unsure if needed -->
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
</module>
</module>
</module>