blob: 6e9e31b5cf62dd340782dd586af21bdd5db85d10 [file] [log] [blame]
Aurimas Liutikas0383fc22016-12-14 19:09:31 -08001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 ~ Copyright (C) 2016 The Android Open Source Project
4 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License.
7 ~ You may obtain a copy of the License at
8 ~
9 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~
11 ~ Unless required by applicable law or agreed to in writing, software
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License.
16-->
17<module name="AvoidStarImport">
18 <property name="severity" value="error"/>
19 <property name="excludes" value="org.junit.Assert,org.mockito.Mockito,org.mockito.MockitoAnnotations,org.hamcrest.Matchers"/>
20</module>
21<module name="IllegalCatch">
22 <property name="severity" value="info"/>
23</module>
24<module name="RedundantImport">
25 <message key="import.redundant" value="Redundant import: {0}. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports"/>
26 <property name="severity" value="error"/>
27</module>
28<module name="UnusedImports">
29 <message key="import.unused" value="Unused import: {0}. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports"/>
30 <property name="severity" value="error"/>
31 <property name="processJavadoc" value="true"/>
32</module>
33<module name="PackageName">
34 <property name="severity" value="error"/>
35 <property name="format" value="^[a-z]+(\.[a-z][a-z0-9_]{1,})*$"/>
36</module>
37<module name="SimplifyBooleanExpression">
38 <property name="severity" value="error"/>
39</module>
40<module name="SimplifyBooleanReturn">
41 <property name="severity" value="error"/>
42</module>
43<module name="TypeName">
44 <property name="severity" value="error"/>
45</module>
46<module name="ConstantName">
47 <property name="severity" value="error"/>
48 <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(s[A-Z][a-zA-Z0-9]*)$"/>
49 <message key="name.invalidPattern" value="Static final field names must either be all caps (e.g. int HEIGHT_PX) for 'true' constants, or start with s (e.g. AtomicInteger sNextId or Runnable sSuspendTask) for fields with mutable state or that don't 'feel' like constants."/>
50</module>
51<!-- Non-public, non-static field names start with m. -->
52<module name="MemberName">
53 <property name="severity" value="error"/>
54 <property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
55 <property name="applyToPublic" value="false"/>
56 <message key="name.invalidPattern" value="Non-public, non-static field names start with m."/>
57</module>
58<!-- Static field names start with s. -->
59<module name="StaticVariableName">
60 <property name="severity" value="error"/>
61 <property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/>
62 <property name="applyToPublic" value="false"/>
63 <message key="name.invalidPattern" value="Static field names start with s."/>
64</module>
65<module name="MethodName">
66 <property name="severity" value="error"/>
67 <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
68 <message key="name.invalidPattern" value="Method names should start with a lower case letter (e.g. getWidth())"/>
69</module>
70<module name="ParameterName">
71 <property name="severity" value="error"/>
72</module>
73<module name="LocalFinalVariableName">
74 <property name="severity" value="error"/>
75 <property name="format" value="^m|s|((([ms][a-z0-9])|([a-ln-rt-z]))[a-zA-Z0-9]*)$"/>
76 <message key="name.invalidPattern" value="Local variables should be camel-cased (e.g. int minWidth = 4)."/>
77</module>
78<module name="LocalVariableName">
79 <property name="severity" value="error"/>
80 <property name="format" value="^m|s|((([ms][a-z0-9])|([a-ln-rt-z]))[a-zA-Z0-9]*)$"/>
81 <message key="name.invalidPattern" value="Local variables should be camel-cased (e.g. int minWidth = 4)."/>
82</module>
83<module name="LineLength">
84 <property name="severity" value="error"/>
85 <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
86 <property name="max" value="100"/>
87</module>
88<module name="LeftCurly">
89 <property name="severity" value="error"/>
90</module>
91<module name="RightCurly">
92 <property name="severity" value="error"/>
93</module>
94<module name="NeedBraces">
95 <message key="needBraces" value="if, for, while, and do require curly braces unless they are single-line statements."/>
96 <property name="severity" value="error"/>
97 <property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, LITERAL_IF"/>
98 <property name="allowSingleLineStatement" value="true"/>
99</module>
100<module name="EmptyBlock">
101 <property name="severity" value="error"/>
102 <property name="option" value="text"/>
103 <metadata name="altname" value="EmptyCatchBlock"/>
104</module>
105<module name="UpperEll">
106 <property name="severity" value="error"/>
107</module>
108<module name="FallThrough">
109 <property name="severity" value="error"/>
110 <property name="reliefPattern" value=".*"/>
111</module>
112<module name="ModifierOrder">
113 <property name="severity" value="error"/>
114</module>
115<module name="WhitespaceAround">
116 <property name="severity" value="error"/>
117 <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, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND" />
118 <property name="allowEmptyConstructors" value="true"/>
119 <property name="allowEmptyMethods" value="true"/>
120</module>
121<module name="WhitespaceAfter">
122 <property name="severity" value="error"/>
123 <property name="tokens" value="COMMA, SEMI, TYPECAST"/>
124</module>
125<module name="NoWhitespaceAfter">
126 <property name="severity" value="error"/>
127 <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
128</module>
129<module name="NoWhitespaceBefore">
130 <property name="severity" value="error"/>
131 <property name="allowLineBreaks" value="true"/>
132 <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/>
133</module>
134<module name="GenericWhitespace">
135 <property name="severity" value="error"/>
136 <message key="ws.followed"
137 value="GenericWhitespace ''{0}'' is followed by whitespace."/>
138 <message key="ws.preceded"
139 value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
140 <message key="ws.illegalFollow"
141 value="GenericWhitespace ''{0}'' should followed by whitespace."/>
142 <message key="ws.notPreceded"
143 value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
144</module>
145<module name="EmptyStatement">
146 <property name="severity" value="error"/>
147</module>
148<module name="NoFinalizer">
149 <property name="severity" value="info"/>
150</module>
151<module name="ParenPad">
152 <property name="severity" value="error"/>
153</module>
154<module name="MethodParamPad">
155 <property name="severity" value="error"/>
156</module>
157<module name="ImportOrder">
158 <property name="severity" value="error"/>
159 <message key="import.ordering" value="Wrong order for {0} import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports"/>
160 <property name="groups" value="android, com.android, dalvik, com, gov, junit, libcore, net, org, java, javax"/>
161 <property name="ordered" value="true"/>
162 <property name="option" value="top"/>
163 <property name="separated" value="true"/>
164</module>
165<module name="Indentation">
166 <property name="severity" value="error"/>
167 <property name="basicOffset" value="4"/>
168 <property name="throwsIndent" value="8"/>
169 <property name="lineWrappingIndentation" value="8"/>
170</module>
171<module name="OperatorWrap">
172 <property name="severity" value="error"/>
173 <property name="option" value="NL" />
174 <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR " />
175</module>
176<module name="OperatorWrap">
177 <property name="severity" value="error"/>
178 <property name="option" value="eol"/>
179 <property name="tokens" value="ASSIGN"/>
180</module>
181<module name="SeparatorWrap">
182 <property name="severity" value="error"/>
183 <property name="tokens" value="DOT"/>
184 <property name="option" value="nl"/>
185</module>
186<module name="SeparatorWrap">
187 <property name="severity" value="error"/>
188 <property name="tokens" value="COMMA"/>
189 <property name="option" value="EOL"/>
190</module>
191<module name="MissingDeprecated">
192 <property name="severity" value="error"/>
193</module>
194<module name="MissingOverride">
195 <property name="severity" value="error"/>
196</module>
197<module name="OneTopLevelClass">
198 <property name="severity" value="error"/>
199</module>
200<module name="StringLiteralEquality">
201 <property name="severity" value="error"/>
202</module>
203<module name="ArrayTypeStyle">
204 <property name="severity" value="error"/>
205</module>
206<module name="RedundantModifier">
207 <property name="severity" value="error"/>
208</module>
209<module name="OuterTypeFilename">
210 <property name="severity" value="error"/>
211</module>
212<module name="FileContentsHolder"/>