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

Side by Side Diff: checkstyle/java/rules/eyeo_test_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 Checkstyle configuration that checks the sun coding conventions from:
9
10 - the Java Language Specification at
11 http://java.sun.com/docs/books/jls/second_edition/html/index.html
12
13 - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
14
15 - the Javadoc guidelines at
16 http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
17
18 - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
19
20 - some best practices
21
22 Checkstyle is very configurable. Be sure to read the documentation at
23 http://checkstyle.sf.net (or in your downloaded distribution).
24
25 Most Checks are configurable, be sure to consult the documentation.
26
27 To completely disable a check, just comment it out or delete it from the file.
28
29 Finally, it is worth reading the documentation.
30
31 -->
32
33 <module name="Checker">
34 <!--
35 If you set the basedir property below, then all reported file
36 names will be relative to the specified directory. See
37 http://checkstyle.sourceforge.net/5.x/config.html#Checker
38
39 <property name="basedir" value="${basedir}"/>
40 -->
41
42 <property name="fileExtensions" value="java, properties, xml"/>
43
44 <!-- Checks whether files end with a new line. -->
45 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
46 <module name="NewlineAtEndOfFile"/>
47
48 <!-- Checks for Size Violations. -->
49 <!-- See http://checkstyle.sf.net/config_sizes.html -->
50 <module name="FileLength"/>
51
52 <!-- Checks for whitespace -->
53 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
54 <module name="FileTabCharacter"/>
55
56 <!-- Miscellaneous other checks. -->
57 <!-- See http://checkstyle.sf.net/config_misc.html -->
58 <module name="RegexpSingleline">
59 <property name="format" value="\s+$"/>
60 <property name="minimum" value="0"/>
61 <property name="maximum" value="0"/>
62 <property name="message" value="Line has trailing spaces."/>
63 </module>
64
65 <!-- Checks for Headers -->
66 <!-- See http://checkstyle.sf.net/config_header.html -->
67 <module name="Header">
68 <property name="headerFile" value="${checkstyle.header.file}"/>
69 <property name="fileExtensions" value="java"/>
70 <property name="fileExtensions" value="cpp"/>
71 <property name="fileExtensions" value="h"/>
72 </module>
73
74 <module name="TreeWalker">
75
76 <!-- Checks for Javadoc comments. -->
77 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
78 <!-- <module name="JavadocMethod"/> -->
79 <!-- <module name="JavadocType"/> -->
80 <!-- <module name="JavadocVariable"/> -->
81 <!-- <module name="JavadocStyle"/> -->
82
83 <!-- Checks for Naming Conventions. -->
84 <!-- See http://checkstyle.sf.net/config_naming.html -->
85 <module name="ConstantName">
86 <property name="applyToPrivate" value="false"/>
87 </module>
88 <module name="LocalFinalVariableName"/>
89 <module name="LocalVariableName"/>
90 <module name="MemberName"/>
91 <module name="MethodName">
92 <!-- added `_` to default format `^[a-z][a-zA-Z0-9]*$` -->
93 <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
94 </module>
95 <module name="PackageName"/>
96 <module name="ParameterName"/>
97 <module name="StaticVariableName"/>
98 <module name="TypeName"/>
99
100 <!-- Checks for imports -->
101 <!-- See http://checkstyle.sf.net/config_imports.html -->
102 <module name="AvoidStarImport"/>
103 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
104 <module name="RedundantImport"/>
105 <module name="UnusedImports">
106 <property name="processJavadoc" value="false"/>
107 </module>
108 <module name="ImportOrder">
109 <!-- Android's import guidelines: http://source.android.com/source/c ode-style.html#order-import-statements -->
110 <property name="groups" value="org.adblockplus,com,net,org,android,j ava,javax"/>
111 <property name="separated" value="true"/>
112 </module>
113
114 <!-- Checks for Size Violations. -->
115 <!-- See http://checkstyle.sf.net/config_sizes.html -->
116 <module name="LineLength">
117 <property name="max" value="100"/>
118 </module>
119 <module name="MethodLength"/>
120 <module name="ParameterNumber"/>
121
122 <!-- Checks for whitespace -->
123 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
124 <module name="EmptyForIteratorPad"/>
125 <module name="GenericWhitespace"/>
126 <module name="MethodParamPad"/>
127 <module name="NoWhitespaceAfter"/>
128 <module name="NoWhitespaceBefore"/>
129 <!-- <module name="OperatorWrap"/> -->
130 <module name="ParenPad"/>
131 <module name="TypecastParenPad"/>
132 <module name="WhitespaceAfter"/>
133 <module name="WhitespaceAround"/>
134
135 <!-- Modifier Checks -->
136 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
137 <module name="ModifierOrder"/>
138 <module name="RedundantModifier"/>
139
140 <!-- Checks for blocks. You know, those {}'s -->
141 <!-- See http://checkstyle.sf.net/config_blocks.html -->
142 <module name="AvoidNestedBlocks"/>
143 <!--<module name="EmptyBlock"/>-->
144 <module name="LeftCurly">
145 <property name="option" value="nl"/>
146 </module>
147 <module name="NeedBraces"/>
148 <module name="RightCurly">
149 <property name="option" value="alone_or_singleline"/>
150 </module>
151
152 <!-- Checks for common coding problems -->
153 <!-- See http://checkstyle.sf.net/config_coding.html -->
154 <!--<module name="AvoidInlineConditionals"/>-->
155 <module name="EmptyStatement"/>
156 <module name="EqualsHashCode"/>
157 <!-- <module name="HiddenField"/> -->
158 <module name="IllegalInstantiation"/>
159 <module name="InnerAssignment"/>
160 <!--<module name="MagicNumber"/>-->
161 <module name="MissingSwitchDefault"/>
162 <module name="SimplifyBooleanExpression"/>
163 <module name="SimplifyBooleanReturn"/>
164
165 <!-- Checks for class design -->
166 <!-- See http://checkstyle.sf.net/config_design.html -->
167 <!-- <module name="DesignForExtension"/> -->
168 <module name="FinalClass"/>
169 <module name="HideUtilityClassConstructor"/>
170 <module name="InterfaceIsType"/>
171 <!-- <module name="VisibilityModifier"/> -->
172
173 <!-- Miscellaneous other checks. -->
174 <!-- See http://checkstyle.sf.net/config_misc.html -->
175 <module name="ArrayTypeStyle"/>
176 <module name="Indentation">
177 <property name="basicOffset" value="2"/>
178 <property name="caseIndent" value="2"/>
179 <property name="throwsIndent" value="2"/>
180 <property name="lineWrappingIndentation" value="2"/>
181 </module>
182 <!-- <module name="FinalParameters"/> -->
183 <module name="TodoComment"/>
184 <module name="UpperEll"/>
185
186 </module>
187
188 </module>
OLDNEW

Powered by Google App Engine
This is Rietveld