forked from axieum/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.checkstyle.xml
199 lines (178 loc) · 8.36 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0"?>
<!-- https://checkstyle.org -->
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Checker properties -->
<!-- See https://checkstyle.org/config.html#Checker_Properties -->
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java"/>
<property name="localeLanguage" value="en"/>
<property name="localeCountry" value="US"/>
<property name="severity" value="error"/>
<property name="tabWidth" value="4"/>
<!-- Checks whether files end with a new line -->
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks for size violations -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
</module>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter"/>
<module name="RegexpMultiline">
<property name="format" value="\n[\t ]*\r?\n[\t ]*\r?\n"/>
<property name="message" value="Multiple adjacent blank lines."/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing whitespace."/>
</module>
<!-- Checks for headers -->
<!-- See https://checkstyle.org/config_header.html -->
<!-- <module name="Header">
<property name="fileExtensions" value="java"/>
<property name="headerFile" value="LICENCE.txt"/>
</module> -->
<!-- Checks that a package-info.java file exists for each package -->
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<!-- <module name="JavadocPackage"/> -->
<module name="TreeWalker">
<!-- Checks for imports -->
<!-- See https://checkstyle.org/config_imports.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
<!-- todo: replace 'com.example' import group -->
<property name="groups" value="java,javax,*,com.mojang,net.minecraft,net.fabricmc,com.example"/>
<property name="separated" value="true"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for class design -->
<!-- See https://checkstyle.org/config_design.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="OneTopLevelClass"/>
<!-- Checks for annotations -->
<!-- See https://checkstyle.org/config_annotation.html -->
<module name="AnnotationLocation"/>
<module name="MissingOverride"/>
<module name="SuppressWarningsHolder"/>
<!-- Checks for modifiers -->
<!-- See https://checkstyle.org/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/config_coding.html -->
<module name="ArrayTrailingComma"/> <!-- cleaner diffs -->
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="MissingSwitchDefault"/>
<module name="PackageDeclaration"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<!-- Checks for blocks, i.e. { ... } -->
<!-- See https://checkstyle.org/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock"/>
<!-- <module name="LeftCurly"/>-->
<!-- <module name="NeedBraces"/>-->
<!-- <module name="RightCurly"/>-->
<!-- Checks for K&R brace styling -->
<!-- See https://en.wikipedia.org/wiki/Indentation_style#K&R_style -->
<module name="LeftCurly"> <!-- braces on new line for class structure -->
<property name="option" value="nl"/>
<property name="tokens" value="ANNOTATION_DEF,CLASS_DEF,CTOR_DEF,ENUM_DEF,INTERFACE_DEF,METHOD_DEF,OBJBLOCK,RECORD_DEF"/>
</module>
<module name="LeftCurly"> <!-- braces at end of line within blocks -->
<property name="option" value="eol"/>
<property name="tokens" value="ENUM_CONSTANT_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,STATIC_INIT,COMPACT_CTOR_DEF"/>
</module>
<module name="RightCurly"/>
<!-- Checks for naming conventions -->
<!-- See https://checkstyle.org/config_naming.html -->
<module name="CatchParameterName"/>
<module name="ClassTypeParameterName"/>
<module name="ConstantName"/>
<module name="IllegalIdentifierName"/>
<module name="InterfaceTypeParameterName"/>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="PatternVariableName"/>
<module name="RecordComponentName"/>
<module name="RecordTypeParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for Javadoc comments -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod"/>
<module name="JavadocParagraph"/>
<module name="JavadocStyle"/>
<module name="JavadocType"/>
<!-- <module name="MissingJavadocMethod"/> -->
<!-- <module name="MissingJavadocPackage"/> -->
<!-- <module name="MissingJavadocType"/> -->
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
<module name="SingleLineJavadoc"/>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="EmptyLineSeparator">
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="allowEmptyCatches" value="true"/>
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
</module>
<!-- Miscellaneous checks -->
<!-- See https://checkstyle.org/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="CommentsIndentation"/>
<module name="Indentation"/>
<module name="OuterTypeFilename"/>
<module name="TodoComment"/>
<module name="UpperEll"/>
</module>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Enables suppression of audit events -->
<!-- See https://checkstyle.org/config_filters.html#SuppressWarningsFilter -->
<module name="SuppressWarningsFilter"/>
</module>