-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckstyle.xml
163 lines (136 loc) · 6.81 KB
/
checkstyle.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Ignore module-info.java files when compiling with JDK 11+ -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks that there are no tab characters ('\t') in the source code. -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
<property name="fileExtensions" value="java,css,js,xml,jsp"/>
</module>
<!-- Checks for long lines. -->
<module name="LineLength">
<property name="max" value="120"/>
<property name="fileExtensions" value="java"/>
</module>
<module name="TreeWalker">
<!-- Check for invalid whitespace before commas, semicolons, etc -->
<module name="NoWhitespaceBefore" />
<!-- Check for empty statements -->
<module name="EmptyStatement"/>
<!-- Check that any module that implements equals or hashCode also implements the other -->
<module name="EqualsHashCode"/>
<!-- Checks for redundant import statements -->
<module name="RedundantImport"/>
<!-- Checks for unused import statements -->
<module name="UnusedImports"/>
<module name="RedundantModifier">
<!-- Checks for redundant modifiers on various symbol definitions.
See: http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
-->
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
</module>
<module name="ImportOrder">
<property name="severity" value="error"/>
<property name="groups" value="*,jakarta,javax,java"/>
<property name="option" value="bottom"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT"/>
<property name="separated" value="true"/>
</module>
<module name="ModifierOrder">
<!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
8.4.3. The prescribed order is:
public, protected, private, abstract, static, final, transient, volatile,
synchronized, native, strictfp
-->
<property name="severity" value="error"/>
</module>
<!-- Block import statements that use the * notation. -->
<!-- <module name="AvoidStarImport">
<property name="excludes" value="jakarta.ws.rs,jakarta.ws.rs.core,org.junit.jupiter.api.Assertions,org.mockito.Mockito,org.mockito.ArgumentMatchers"/>
</module> -->
<!-- Javadoc Checks -->
<module name="JavadocParagraph"/>
<module name="JavadocType">
<property name="severity" value="error"/>
<property name="scope" value="public"/>
<property name="excludeScope" value="anoninner"/>
<property name="allowMissingParamTags" value="false"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
</module>
<module name="JavadocStyle">
<property name="severity" value="error"/>
<property name="checkHtml" value="true"/>
</module>
<module name="MethodName">
<property name="severity" value="error"/>
</module>
<module name="ParameterName">
<property name="severity" value="error"/>
</module>
<module name="LocalVariableName">
<property name="severity" value="error"/>
</module>
<module name="LocalFinalVariableName">
<!-- Validates identifiers for local final variables against the
expression "^[a-z][a-zA-Z0-9]*$". -->
<property name="severity" value="error"/>
</module>
<!-- Type parameters must be either one of the four blessed letters
T, U, K, V, W, X or else be capital-case terminated with a T,
such as MyGenericParameterT -->
<module name="ClassTypeParameterName">
<property name="format" value="^(((T|U|K|V|W|X|R)[0-9]*)|([A-Z][a-z][a-zA-Z]*))$"/>
<property name="severity" value="error"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^(((T|U|K|V|W|X|R)[0-9]*)|([A-Z][a-z][a-zA-Z]*T))$"/>
<property name="severity" value="error"/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^(((T|U|K|V|W|X|R)[0-9]*)|([A-Z][a-z][a-zA-Z]*T))$"/>
<property name="severity" value="error"/>
</module>
<!-- K&R style braces -->
<!-- <module name="NeedBraces"/> -->
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="WhitespaceAround">
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, 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"
/>
</module>
<module name="Indentation">
<property name="throwsIndent" value="8"/>
</module>
<module name="SuppressWarningsHolder"/>
<module name="FinalClass"/>
<module name="FinalLocalVariable"/>
<module name="FinalParameters"/>
<module name="GenericWhitespace"/>
<module name="HideUtilityClassConstructor"/>
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="4"/>
<property name="ignoreStringsRegexp" value='^(?:("\\"")|(",")|("=")|(""))$'/>
</module>
<module name="MultipleVariableDeclarations"/>
</module>
<!-- No Trailing Whitespace, except on lines that only have an asterisk (e.g. Javadoc comments) -->
<module name="RegexpSingleline">
<property name="format" value="(?<!\*)\s+$|\*\s\s+$"/>
<property name="message" value="Trailing whitespace"/>
<property name="fileExtensions" value="java,css,js,xml"/>
</module>
<module name="SuppressWarningsFilter" />
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppressions.xml"/>
<property name="optional" value="false"/>
</module>
</module>