1
+ <?xml version =" 1.0" ?>
2
+ <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
3
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
4
+ <module name =" Checker" >
5
+ <property name =" charset" value =" UTF-8" />
6
+ <property name =" fileExtensions" value =" java" />
7
+ <property name =" localeLanguage" value =" en" />
8
+ <property name =" localeCountry" value =" US" />
9
+ <property name =" tabWidth" value =" 4" />
10
+
11
+ <module name =" NewlineAtEndOfFile" />
12
+
13
+ <!-- disallow trailing whitespace -->
14
+ <module name =" RegexpSingleline" >
15
+ <property name =" format" value =" \s+$" />
16
+ <property name =" message" value =" Trailing whitespace" />
17
+ </module >
18
+
19
+ <!-- note: RegexpMultiline shows nicer messages than Regexp,but has to be outside TreeWalker -->
20
+ <!-- disallow multiple consecutive blank lines -->
21
+ <module name =" RegexpMultiline" >
22
+ <property name =" format" value =" \n[\t ]*\r?\n[\t ]*\r?\n" />
23
+ <property name =" message" value =" Adjacent blank lines" />
24
+ </module >
25
+
26
+ <!-- disallow blank after { -->
27
+ <!-- <module name="RegexpMultiline">
28
+ <property name="format" value="\{[\t ]*\r?\n[\t ]*\r?\n"/>
29
+ <property name="message" value="Blank line after '{'"/>
30
+ </module> -->
31
+
32
+ <!-- disallow blank before } -->
33
+ <module name =" RegexpMultiline" >
34
+ <property name =" format" value =" \n[\t ]*\r?\n[\t ]*\}" />
35
+ <property name =" message" value =" Blank line before '}'" />
36
+ </module >
37
+
38
+ <!-- require blank before { in the same indentation level -->
39
+ <module name =" RegexpMultiline" >
40
+ <!-- the regex works as follows:
41
+ It matches (=fails) for \n<indentation><something>\n<same indentation><control statement>[...]{\n
42
+ while <something> is a single line comment,it'll look for a blank line one line earlier
43
+ if <something> is a space,indicating a formatting error or ' */',it'll ignore the instance
44
+ if <something> is a tab,indicating a continued line,it'll ignore the instance
45
+ <control statement> is 'if','do','while','for','try' or nothing (instance initializer block)
46
+ - first \n: with positive lookbehind (?<=\n) to move the error marker to a more reasonable place
47
+ - capture tabs for <indentation>,later referenced via \1
48
+ - remaining preceding line as a non-comment (doesn't start with '/','//',' ' or '\t') or multiple lines where all but the first are a single line comment with the same indentation
49
+ - new line
50
+ - <indentation> as captured earlier
51
+ - <control statement> as specified above
52
+ - { before the next new line -->
53
+ <property name =" format"
54
+ value =" (?< =\n)([\t]+)(?:[^/\r\n \t][^\r\n]*|/[^/\r\n][^\r\n]*|[^/\r\n][^\r\n]*(\r?\n\1//[^\r\n]*)+)\r?\n\1(|(if|do|while|for|try)[^\r\n]+)\{[\t ]*\r?\n" />
55
+ <property name =" message" value =" Missing blank line before block at same indentation level" />
56
+ </module >
57
+
58
+ <!-- require blank after } in the same indentation level -->
59
+ <module name =" RegexpMultiline" >
60
+ <!-- \n<indentation>}\n<same indentation><whatever unless newline,'}' or starting with cas(e) or def(ault)> -->
61
+ <property name =" format"
62
+ value =" (?< =\n)([\t]+)\}\r?\n\1(?:[^\r\n\}cd]|c[^\r\na]|ca[^\r\ns]|d[^\r\ne]|de[^\r\nf])" />
63
+ <property name =" message" value =" Missing blank line after block at same indentation level" />
64
+ </module >
65
+
66
+ <module name =" TreeWalker" >
67
+ <!-- Ensure all imports are ship shape -->
68
+ <module name =" AvoidStarImport" />
69
+ <module name =" IllegalImport" />
70
+ <module name =" RedundantImport" />
71
+ <module name =" UnusedImports" />
72
+
73
+ <module name =" ImportOrder" >
74
+ <property name =" groups" value =" java,javax,net.minecraft,net.fabricmc,motherlode,*" />
75
+ <property name =" ordered"
76
+ value =" false" /><!-- the plugin orders alphabetically without considering separators.. -->
77
+ <property name =" separated" value =" false" />
78
+ <property name =" option" value =" bottom" />
79
+ <property name =" sortStaticImportsAlphabetically" value =" false" />
80
+ </module >
81
+
82
+ <!-- Ensures braces are at the end of a line -->
83
+ <module name =" LeftCurly" />
84
+ <module name =" RightCurly" />
85
+
86
+ <module name =" EmptyLineSeparator" >
87
+ <property name =" allowNoEmptyLineBetweenFields" value =" true" />
88
+ <property name =" allowMultipleEmptyLines" value =" false" />
89
+ <!-- exclude METHOD_DEF and VARIABLE_DEF -->
90
+ <property name =" tokens"
91
+ value =" PACKAGE_DEF,IMPORT,STATIC_IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,CTOR_DEF" />
92
+ </module >
93
+
94
+ <module name =" OperatorWrap" >
95
+ <!-- Exclude QUESTION and COLON -->
96
+ <property name =" tokens"
97
+ value =" EQUAL,NOT_EQUAL,DIV,PLUS,MINUS,STAR,MOD,SR,BSR,GE,GT,SL,LE,LT,BXOR,BOR,LOR,BAND,LAND,TYPE_EXTENSION_AND,LITERAL_INSTANCEOF" />
98
+ </module >
99
+ <module name =" SeparatorWrap" >
100
+ <property name =" tokens" value =" DOT,ELLIPSIS,AT" />
101
+ <property name =" option" value =" nl" />
102
+ </module >
103
+ <module name =" SeparatorWrap" >
104
+ <property name =" tokens" value =" COMMA,SEMI" />
105
+ <property name =" option" value =" eol" />
106
+ </module >
107
+
108
+ <module name =" Indentation" >
109
+ <property name =" basicOffset" value =" 4" />
110
+ <property name =" caseIndent" value =" 4" />
111
+ <property name =" throwsIndent" value =" 4" />
112
+ <property name =" arrayInitIndent" value =" 4" />
113
+ <property name =" lineWrappingIndentation" value =" 4" />
114
+ </module >
115
+
116
+ <module name =" ParenPad" />
117
+ <module name =" NoWhitespaceBefore" />
118
+ <module name =" NoWhitespaceAfter" >
119
+ <!-- allow ARRAY_INIT -->
120
+ <property name =" tokens" value =" AT,INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP" />
121
+ </module >
122
+ <module name =" WhitespaceAfter" />
123
+ <module name =" WhitespaceAround" >
124
+ <!-- Allow PLUS,MINUS,STAR,DIV as they may be more readable without spaces in some cases -->
125
+ <property name =" tokens"
126
+ value =" ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND" />
127
+ </module >
128
+ <module name =" SingleSpaceSeparator" />
129
+ <module name =" GenericWhitespace" />
130
+ <module name =" CommentsIndentation" />
131
+
132
+ <module name =" ArrayTypeStyle" />
133
+ <module name =" DefaultComesLast" >
134
+ <property name =" skipIfLastAndSharedWithCase" value =" true" />
135
+ </module >
136
+ <module name =" SimplifyBooleanExpression" />
137
+ <module name =" SimplifyBooleanReturn" />
138
+ <module name =" StringLiteralEquality" />
139
+
140
+ <module name =" ModifierOrder" />
141
+ <module name =" RedundantModifier" />
142
+
143
+ <module name =" AnnotationLocation" />
144
+ <module name =" MissingOverride" />
145
+
146
+ <!-- By default this allows catch blocks with only comments -->
147
+ <module name =" EmptyCatchBlock" />
148
+
149
+ <module name =" OuterTypeFilename" />
150
+ <module name =" PackageDeclaration" />
151
+ <module name =" PackageName" >
152
+ <property name =" format"
153
+ value =" ^motherlode\.[a-z]+(\.[a-z0-9]+)*$" />
154
+ </module >
155
+
156
+ <!-- <module name="InvalidJavadocPosition"/>-->
157
+ <module name =" JavadocParagraph" />
158
+ <module name =" JavadocStyle" />
159
+ <module name =" AtclauseOrder" >
160
+ <property name =" tagOrder" value =" @param,@return,@throws,@deprecated" />
161
+ </module >
162
+ </module >
163
+ </module >
0 commit comments