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

Side by Side Diff: third_party/checkstyle/java/rules/sun_checks.xml

Issue 29347926: Issue 4248 - Add codestyle check
Patch Set: changed import order - `org.adblockplus` package first Created Dec. 2, 2016, 6:19 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
diegocarloslima 2017/04/07 13:46:38 Maybe would be good the put the link of where this
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 that a package-info.java file exists for each package. -->
45 <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
46 <!-- <module name="JavadocPackage"/> -->
47
48 <!-- Checks whether files end with a new line. -->
49 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
50 <module name="NewlineAtEndOfFile"/>
51
52 <!-- Checks that property files contain the same keys. -->
53 <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
54 <module name="Translation"/>
55
56 <!-- Checks for Size Violations. -->
57 <!-- See http://checkstyle.sf.net/config_sizes.html -->
58 <module name="FileLength"/>
59
60 <!-- Checks for whitespace -->
61 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
62 <module name="FileTabCharacter"/>
63
64 <!-- Miscellaneous other checks. -->
65 <!-- See http://checkstyle.sf.net/config_misc.html -->
66 <module name="RegexpSingleline">
67 <property name="format" value="\s+$"/>
68 <property name="minimum" value="0"/>
69 <property name="maximum" value="0"/>
70 <property name="message" value="Line has trailing spaces."/>
71 </module>
72
73 <!-- Checks for Headers -->
74 <!-- See http://checkstyle.sf.net/config_header.html -->
75 <!-- <module name="Header"> -->
76 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
77 <!-- <property name="fileExtensions" value="java"/> -->
78 <!-- </module> -->
79
80 <module name="TreeWalker">
81
82 <!-- Checks for Javadoc comments. -->
83 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
84 <!-- <module name="JavadocMethod"/> -->
85 <!-- <module name="JavadocType"/> -->
86 <!-- <module name="JavadocVariable"/> -->
87 <!-- <module name="JavadocStyle"/> -->
88
89 <!-- Checks for Naming Conventions. -->
90 <!-- See http://checkstyle.sf.net/config_naming.html -->
91 <module name="ConstantName"/>
92 <module name="LocalFinalVariableName"/>
93 <module name="LocalVariableName"/>
94 <module name="MemberName"/>
95 <module name="MethodName"/>
96 <module name="PackageName"/>
97 <module name="ParameterName"/>
98 <module name="StaticVariableName"/>
99 <module name="TypeName"/>
100
101 <!-- Checks for imports -->
102 <!-- See http://checkstyle.sf.net/config_import.html -->
103 <module name="AvoidStarImport"/>
104 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
105 <module name="RedundantImport"/>
106 <module name="UnusedImports">
107 <property name="processJavadoc" value="false"/>
108 </module>
109
110 <!-- Checks for Size Violations. -->
111 <!-- See http://checkstyle.sf.net/config_sizes.html -->
112 <module name="LineLength">
113 <property name="max" value="100"/>
114 </module>
115 <module name="MethodLength"/>
116 <module name="ParameterNumber"/>
117
118 <!-- Checks for whitespace -->
119 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
120 <module name="EmptyForIteratorPad"/>
121 <module name="GenericWhitespace"/>
122 <module name="MethodParamPad"/>
123 <module name="NoWhitespaceAfter"/>
124 <module name="NoWhitespaceBefore"/>
125 <!-- <module name="OperatorWrap"/> -->
126 <module name="ParenPad"/>
127 <module name="TypecastParenPad"/>
128 <module name="WhitespaceAfter"/>
129 <module name="WhitespaceAround"/>
130
131 <!-- Modifier Checks -->
132 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
133 <module name="ModifierOrder"/>
134 <module name="RedundantModifier"/>
135
136 <!-- Checks for blocks. You know, those {}'s -->
137 <!-- See http://checkstyle.sf.net/config_blocks.html -->
138 <module name="AvoidNestedBlocks"/>
139 <!-- <module name="EmptyBlock"/> -->
140 <module name="LeftCurly">
141 <property name="option" value="nl"/>
142 </module>
143 <module name="NeedBraces"/>
144 <module name="RightCurly">
145 <property name="shouldStartLine" value="true"/>
146 </module>
147
148 <!-- Checks for common coding problems -->
149 <!-- See http://checkstyle.sf.net/config_coding.html -->
150 <module name="AvoidInlineConditionals"/>
151 <module name="EmptyStatement"/>
152 <module name="EqualsHashCode"/>
153 <!-- <module name="HiddenField"/> -->
154 <module name="IllegalInstantiation"/>
155 <module name="InnerAssignment"/>
156 <module name="MagicNumber"/>
157 <module name="MissingSwitchDefault"/>
158 <module name="SimplifyBooleanExpression"/>
159 <module name="SimplifyBooleanReturn"/>
160
161 <!-- Checks for class design -->
162 <!-- See http://checkstyle.sf.net/config_design.html -->
163 <!-- <module name="DesignForExtension"/> -->
164 <module name="FinalClass"/>
165 <module name="HideUtilityClassConstructor"/>
166 <module name="InterfaceIsType"/>
167 <module name="VisibilityModifier"/>
168
169 <!-- Miscellaneous other checks. -->
170 <!-- See http://checkstyle.sf.net/config_misc.html -->
171 <module name="ArrayTypeStyle"/>
172 <!-- <module name="FinalParameters"/> -->
173 <module name="TodoComment"/>
174 <module name="UpperEll"/>
175
176 </module>
177
178 </module>
OLDNEW

Powered by Google App Engine
This is Rietveld