-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckstyle.xml
More file actions
99 lines (89 loc) · 4.02 KB
/
Copy pathcheckstyle.xml
File metadata and controls
99 lines (89 loc) · 4.02 KB
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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
The style the generator writes and the hand-written half is held to.
Checkstyle rather than a rewriting formatter, and for the same reason RuboCop guards the Ruby
client: this check validates, it never corrects. A job that rewrote what it was checking would
report success on source nobody wrote, and the emitter — not a pass after it — stays the one place
that decides what the generated half looks like.
Every rule below is one the emitter satisfies as it emits: the margin it folds comments and calls
at, the indentation it writes, the import block it sorts, and the documentation it puts on every
public type.
-->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
<property name="fileExtensions" value="java"/>
<!-- Nothing is written past the margin the emitter folds at. -->
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^\s*(//|\*) *https?://"/>
</module>
<module name="NewlineAtEndOfFile"/>
<module name="FileTabCharacter"/>
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="a line ends in whitespace"/>
</module>
<module name="TreeWalker">
<!-- Imports: one sorted block, nothing unused, nothing wholesale. -->
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="CustomImportOrder">
<!--
Two groups: what a file imports statically, then what it imports as a type, each sorted the
way plain string ordering sorts it. The generated half never imports statically, so its
block is one group and the emitter sorts it as it writes it.
-->
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
</module>
<!-- Naming, as every Java reader expects it. -->
<module name="PackageName"/>
<module name="TypeName"/>
<module name="MethodName"/>
<module name="MemberName"/>
<module name="ParameterName"/>
<module name="LocalVariableName"/>
<module name="ConstantName"/>
<!-- Layout the emitter writes and a hand edit has to keep. -->
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="NeedBraces"/>
<module name="WhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="ParenPad"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
<property name="tokens"
value="PACKAGE_DEF, IMPORT, CLASS_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF, CTOR_DEF, METHOD_DEF"/>
</module>
<!-- Every public type says what it is. -->
<module name="MissingJavadocType">
<property name="scope" value="public"/>
</module>
<!-- Defects the compiler does not report. -->
<module name="EqualsHashCode"/>
<module name="StringLiteralEquality"/>
<module name="FallThrough"/>
<!--
`MissingSwitchDefault` is deliberately absent. The generated match over the problem catalogue
is a switch expression over a closed enumeration, and its exhaustiveness is what turns a
problem the API grows into a compilation failure. A default branch would answer for the new
value instead, and the compiler would stop mentioning it.
-->
<module name="ModifierOrder"/>
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="OneTopLevelClass"/>
<module name="OuterTypeFilename"/>
</module>
</module>