forked from folio-org/mod-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codestyles.xml
58 lines (56 loc) · 3.16 KB
/
codestyles.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
<?xml version="1.0" ?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="fileExtensions" value="java, xml, json, properties" />
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="TreeWalker">
<module name="EmptyStatement"/>
<property name="tabWidth" value="2" />
<module name="AvoidStarImport" />
<module name="EmptyBlock" />
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF" /> <!-- max lines for a function -->
<property name="max" value="200" />
<property name="countEmpty" value="false"/>
</module>
<module name="MethodLength">
<property name="tokens" value="CTOR_DEF" /> <!-- max lines for a constructor -->
<property name="max" value="20" />
</module>
<module name="AnonInnerLength">
<property name="max" value="30"/> <!-- max lines for inner class / lambda - note java spec = 20 -->
</module>
<module name="AvoidInlineConditionals"/> <!-- Some developers find inline conditionals hard to read -->
<module name="AvoidStaticImport"> <!-- avoid static imports as they are confusing, allow the list included below -->
<property name="excludes" value="java.lang.System.out,java.lang.Math.*"/>
</module>
<module name="ClassDataAbstractionCoupling"> <!-- the number of instantiations of other classes within the given class -->
<property name="max" value="10"/>
<!-- since cannot pass RMB generated objects as a package with wildcard, thershold may be exceeded, changing this to warning -->
<property name="severity" value="warning"/>
</module>
<module name="ConstantName"> <!-- Validates identifiers for constants (static, final fields). -->
<property name="format" value="^log(ger)?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
<module name="DeclarationOrder"/> <!-- Class (static) variables, instance vars, constructors, methods -->
<module name="EmptyCatchBlock"> <!-- Checks for empty catch blocks,
except is if exception's variable name is expected or ignore or there's any comment inside: -->
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="VisibilityModifier"> <!-- Checks visibility of class members, allow package visibility of class members that are not
static final, immutable or annotated by specified annotation members may be public -->
<property name="packageAllowed" value="true"/>
</module>
<module name="StaticVariableName"/> <!-- Validates identifiers for static, non-final fields. ^[a-z][a-zA-Z0-9]*$ -->
<module name="TypeName" /> <!-- Validates identifiers for classes, interfaces, enums, and annotations. -->
<module name="SuppressWarningsHolder" /> <!-- provide @SuppressWarnings annotations -->
</module>
<module name="SuppressWarningsFilter" /> <!-- filter using @SuppressWarnings annotations -->
</module>