Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: checkstyle/java/rules/google_checks.xml

Issue 29567648: Issue 4248 - Add codestyle check
Patch Set: Created Oct. 6, 2017, 11:27 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <?xml version="1.0"?>
2 <!DOCTYPE module PUBLIC
3 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5
6 <!--
7
8 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/goog le_checks.xml
9
10 Checkstyle configuration that checks the Google coding conventions from Goog le Java Style
11 that can be found at https://google.github.io/styleguide/javaguide.html.
12
13 Checkstyle is very configurable. Be sure to read the documentation at
14 http://checkstyle.sf.net (or in your downloaded distribution).
15
16 To completely disable a check, just comment it out or delete it from the fil e.
17
18 Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
19 -->
20
21 <module name = "Checker">
22 <property name="charset" value="UTF-8"/>
23
24 <property name="severity" value="warning"/>
25
26 <property name="fileExtensions" value="java, properties, xml"/>
27 <!-- Checks for whitespace -->
28 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
29 <module name="FileTabCharacter">
30 <property name="eachLine" value="true"/>
31 </module>
32
33 <module name="TreeWalker">
34 <module name="OuterTypeFilename"/>
35 <module name="IllegalTokenText">
36 <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
37 <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|2 7|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
38 <property name="message" value="Avoid using corresponding octal or U nicode escape."/>
39 </module>
40 <module name="AvoidEscapedUnicodeCharacters">
41 <property name="allowEscapesForControlCharacters" value="true"/>
42 <property name="allowByTailComment" value="true"/>
43 <property name="allowNonPrintableEscapes" value="true"/>
44 </module>
45 <module name="LineLength">
46 <property name="max" value="100"/>
47 <property name="ignorePattern" value="^package.*|^import.*|a href|hr ef|http://|https://|ftp://"/>
48 </module>
49 <module name="AvoidStarImport"/>
50 <module name="OneTopLevelClass"/>
51 <module name="NoLineWrap"/>
52 <module name="EmptyBlock">
53 <property name="option" value="TEXT"/>
54 <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL _IF, LITERAL_ELSE, LITERAL_SWITCH"/>
55 </module>
56 <module name="NeedBraces"/>
57 <module name="LeftCurly">
58 <property name="maxLineLength" value="100"/>
59 </module>
60 <module name="RightCurly"/>
61 <module name="RightCurly">
62 <property name="option" value="alone"/>
63 <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITE RAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
64 </module>
65 <module name="WhitespaceAround">
66 <property name="allowEmptyConstructors" value="true"/>
67 <property name="allowEmptyMethods" value="true"/>
68 <property name="allowEmptyTypes" value="true"/>
69 <property name="allowEmptyLoops" value="true"/>
70 <message key="ws.notFollowed"
71 value="WhitespaceAround: ''{0}'' is not followed by whitespace. Emp ty blocks may only be represented as '{}' when not part of a multi-block stateme nt (4.1.3)"/>
72 <message key="ws.notPreceded"
73 value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/ >
74 </module>
75 <module name="OneStatementPerLine"/>
76 <module name="MultipleVariableDeclarations"/>
77 <module name="ArrayTypeStyle"/>
78 <module name="MissingSwitchDefault"/>
79 <module name="FallThrough"/>
80 <module name="UpperEll"/>
81 <module name="ModifierOrder"/>
82 <module name="EmptyLineSeparator">
83 <property name="allowNoEmptyLineBetweenFields" value="true"/>
84 </module>
85 <module name="SeparatorWrap">
86 <property name="tokens" value="DOT"/>
87 <property name="option" value="nl"/>
88 </module>
89 <module name="SeparatorWrap">
90 <property name="tokens" value="COMMA"/>
91 <property name="option" value="EOL"/>
92 </module>
93 <module name="PackageName">
94 <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
95 <message key="name.invalidPattern"
96 value="Package name ''{0}'' must match pattern ''{1}''."/>
97 </module>
98 <module name="TypeName">
99 <message key="name.invalidPattern"
100 value="Type name ''{0}'' must match pattern ''{1}''."/>
101 </module>
102 <module name="MemberName">
103 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
104 <message key="name.invalidPattern"
105 value="Member name ''{0}'' must match pattern ''{1}''."/>
106 </module>
107 <module name="ParameterName">
108 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
109 <message key="name.invalidPattern"
110 value="Parameter name ''{0}'' must match pattern ''{1}''."/>
111 </module>
112 <module name="CatchParameterName">
113 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
114 <message key="name.invalidPattern"
115 value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
116 </module>
117 <module name="LocalVariableName">
118 <property name="tokens" value="VARIABLE_DEF"/>
119 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
120 <property name="allowOneCharVarInForLoop" value="true"/>
121 <message key="name.invalidPattern"
122 value="Local variable name ''{0}'' must match pattern ''{1}''."/>
123 </module>
124 <module name="ClassTypeParameterName">
125 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T] $)"/>
126 <message key="name.invalidPattern"
127 value="Class type name ''{0}'' must match pattern ''{1}''."/>
128 </module>
129 <module name="MethodTypeParameterName">
130 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T] $)"/>
131 <message key="name.invalidPattern"
132 value="Method type name ''{0}'' must match pattern ''{1}''."/>
133 </module>
134 <module name="InterfaceTypeParameterName">
135 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T] $)"/>
136 <message key="name.invalidPattern"
137 value="Interface type name ''{0}'' must match pattern ''{1}''."/>
138 </module>
139 <module name="NoFinalizer"/>
140 <module name="GenericWhitespace">
141 <message key="ws.followed"
142 value="GenericWhitespace ''{0}'' is followed by whitespace."/>
143 <message key="ws.preceded"
144 value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
145 <message key="ws.illegalFollow"
146 value="GenericWhitespace ''{0}'' should followed by whitespace."/>
147 <message key="ws.notPreceded"
148 value="GenericWhitespace ''{0}'' is not preceded with whitespace."/ >
149 </module>
150 <module name="Indentation">
151 <property name="basicOffset" value="2"/>
152 <property name="braceAdjustment" value="0"/>
153 <property name="caseIndent" value="2"/>
154 <property name="throwsIndent" value="4"/>
155 <property name="lineWrappingIndentation" value="4"/>
156 <property name="arrayInitIndent" value="2"/>
157 </module>
158 <module name="AbbreviationAsWordInName">
159 <property name="ignoreFinal" value="false"/>
160 <property name="allowedAbbreviationLength" value="1"/>
161 </module>
162 <module name="OverloadMethodsDeclarationOrder"/>
163 <module name="VariableDeclarationUsageDistance"/>
164 <module name="CustomImportOrder">
165 <property name="specialImportsRegExp" value="com.google"/>
166 <property name="sortImportsInGroupAlphabetically" value="true"/>
167 <property name="customImportOrderRules" value="STATIC###SPECIAL_IMPO RTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
168 </module>
169 <module name="MethodParamPad"/>
170 <module name="OperatorWrap">
171 <property name="option" value="NL"/>
172 <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTIO N, SL, SR, STAR "/>
173 </module>
174 <module name="AnnotationLocation">
175 <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, M ETHOD_DEF, CTOR_DEF"/>
176 </module>
177 <module name="AnnotationLocation">
178 <property name="tokens" value="VARIABLE_DEF"/>
179 <property name="allowSamelineMultipleAnnotations" value="true"/>
180 </module>
181 <module name="NonEmptyAtclauseDescription"/>
182 <module name="JavadocTagContinuationIndentation"/>
183 <module name="SummaryJavadoc">
184 <property name="forbiddenSummaryFragments" value="^@return the *|^Th is method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
185 </module>
186 <module name="JavadocParagraph"/>
187 <module name="AtclauseOrder">
188 <property name="tagOrder" value="@param, @return, @throws, @deprecat ed"/>
189 <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, M ETHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
190 </module>
191 <module name="JavadocMethod">
192 <property name="scope" value="public"/>
193 <property name="allowMissingParamTags" value="true"/>
194 <property name="allowMissingThrowsTags" value="true"/>
195 <property name="allowMissingReturnTag" value="true"/>
196 <property name="minLineCount" value="2"/>
197 <property name="allowedAnnotations" value="Override, Test"/>
198 <property name="allowThrowsTagsForSubclasses" value="true"/>
199 </module>
200 <module name="MethodName">
201 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
202 <message key="name.invalidPattern"
203 value="Method name ''{0}'' must match pattern ''{1}''."/>
204 </module>
205 <module name="SingleLineJavadoc">
206 <property name="ignoreInlineTags" value="false"/>
207 </module>
208 <module name="EmptyCatchBlock">
209 <property name="exceptionVariableName" value="expected"/>
210 </module>
211 <module name="CommentsIndentation"/>
212 </module>
213 </module>
OLDNEW

Powered by Google App Engine
This is Rietveld