-
Notifications
You must be signed in to change notification settings - Fork 1
/
shared-checkstyle.xml
113 lines (112 loc) · 5.14 KB
/
shared-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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<module name="MissingOverride"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="OneStatementPerLine"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport">
<property
name="illegalPkgs"
value="sun, ru.hh.hhid.abi_shaded, ru.hh.guice.hibernate, junit.framework, org.apache.log4j, org.jetbrains.annotations"
/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="ImportOrder">
<property name="option" value="inflow"/>
<property name="ordered" value="true"/>
<property name="separated" value="false"/>
</module>
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="ParameterName"/>
<module name="IllegalIdentifierName">
<property name="format" value="^[a-zA-Z0-9_]+$"/>
</module>
<module name="OuterTypeNumber"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="ru.hh.checkstyle.NonConstantOptionalOrElseCheck"/>
<module name="ru.hh.checkstyle.WrapNewLinesMethodChainCallsCheck">
<property name="allowUnwrappedFirstCall" value="true"/>
</module>
<module name="Indentation">
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="forceStrictCondition" value="false"/>
</module>
<module name="MatchXpath">
<property
name="query"
value="//COMMENT_CONTENT[contains(@text, '@author') and (starts-with(@text, '*\n') or not(contains(@text, '\n')))]"
/>
<message key="matchxpath.match" value="Avoid using @author tag."/>
</module>
<module name="MatchXpath">
<property
name="query"
value="//VARIABLE_DEF/TYPE/IDENT[@text='var']/../../ASSIGN/EXPR/*[self::LITERAL_FALSE or self::LITERAL_TRUE or self::NUM_INT or self::NUM_LONG or self::NUM_FLOAT or self::NUM_DOUBLE or self::CHAR_LITERAL]"
/>
<message key="matchxpath.match" value="Avoid using var with primitives"/>
</module>
<module name="MatchXpath">
<!-- Check will be skipped in case of @Override annotation. Otherwise, it will be impossible to extend/implement classes/interfaces from 3rd party libraries -->
<property
name="query"
value="//CLASS_DEF/OBJBLOCK/*[self::METHOD_DEF or self::CTOR_DEF][not(MODIFIERS/ANNOTATION/IDENT[@text='Override'])]/PARAMETERS/PARAMETER_DEF/TYPE/IDENT[@text='Optional']"
/>
<message key="matchxpath.match" value="Avoid using Optional in parameters"/>
</module>
<module name="MatchXpath">
<property
name="query"
value="//CLASS_DEF/OBJBLOCK/VARIABLE_DEF/TYPE/IDENT[@text='Optional']"
/>
<message key="matchxpath.match" value="Avoid using Optional in class fields"/>
</module>
<module name="MissingDeprecated"/>
<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,LAMBDA,LAND,LE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN"
/>
</module>
<module name="ArrayTrailingComma"/>
<module name="InnerTypeLast"/>
<module name="SuppressWarningsHolder"/>
</module>
<module name="LineLength">
<property name="max" value="150"/>
</module>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="SuppressWarningsFilter"/>
</module>