forked from Railroad-Team/Railroad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckstyle.xml
More file actions
171 lines (150 loc) · 6.96 KB
/
checkstyle.xml
File metadata and controls
171 lines (150 loc) · 6.96 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
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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!--
This Checker module contains the configuration for the Checkstyle tool.
It defines the checks that will be performed on the Java source code.
The configuration is based on the Google Java Style Guide, with modifications
to match the existing code style of the Railroad project.
-->
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^package .*|^import .*|a href|href"/>
</module>
<!-- Checks for whitespace. -->
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
<module name="FileTabCharacter"/>
<!-- Miscellaneous checks. -->
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
<module name="Translation"/>
<module name="TreeWalker">
<!--
The TreeWalker module processes the Java source code as an abstract syntax tree (AST).
It contains checks that are applied to individual Java files.
-->
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.sourceforge.io/config_naming.html -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="TypeName">
<property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.sourceforge.io/config_javadoc.html -->
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<!-- Checks for Imports. -->
<!-- See https://checkstyle.sourceforge.io/config_imports.html -->
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="IllegalImport"/> <!-- disallow sun.* packages -->
<!-- Checks for Whitespace. -->
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
<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,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,WILDCARD_TYPE"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="NoWhitespaceAfter"/>
<module name="ParenPad"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="WhitespaceAfter"/>
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
<!-- Checks for Modifiers. -->
<!-- See https://checkstyle.sourceforge.io/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for Blocks. -->
<!-- See https://checkstyle.sourceforge.io/config_blocks.html -->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_FOR,LITERAL_WHILE,STATIC_INIT"/>
</module>
<module name="LeftCurly">
<property name="option" value="EOL"/> <!-- K&R style -->
</module>
<module name="RightCurly">
<property name="option" value="SAME"/>
</module>
<!-- Checks for Coding Problems. -->
<!-- See https://checkstyle.sourceforge.io/config_coding.html -->
<module name="EqualsHashCode"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="SuperFinalize"/>
<module name="UnnecessaryParentheses"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="ReturnCount">
<property name="max" value="2"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="IllegalInstantiation"/>
<module name="IllegalTokenText"/>
<module name="IllegalType"/>
<module name="MissingOverride"/>
<module name="NoArrayTrailingComma"/>
<module name="NoEnumTrailingComma"/>
<module name="NoFinalizer"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="OuterTypeFilename"/>
<module name="PackageAnnotation"/>
<module name="ParameterAssignment"/>
<module name="RequireThis"/>
<module name="ThrowsCount"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="ArrayTypeStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="PackageDeclaration"/>
<module name="UnnecessaryParentheses"/>
<module name="VisibilityModifier"/>
<!-- Checks for Class Design. -->
<!-- See https://checkstyle.sourceforge.io/config_design.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="ThrowsCount"/>
<module name="VisibilityModifier"/>
<!-- Metrics. -->
<!-- See https://checkstyle.sourceforge.io/config_metrics.html -->
<module name="CyclomaticComplexity">
<property name="max" value="20"/>
</module>
<module name="JavaNCSS"/>
<module name="NPathComplexity"/>
</module>
</module>