Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enable and add more checkstyle rules.

  • Loading branch information...
commit cdc51e039a19defd7562200461c001212c9c0dcc 1 parent 0662a65
Jake Wharton JakeWharton authored
18 checkstyle.xml
View
@@ -14,6 +14,18 @@
<property name="message" value="Line has trailing spaces."/>
</module>
+ <!-- Space after 'for' and 'if' -->
+ <module name="RegexpSingleline">
+ <property name="format" value="^\s*(for|if)[^ ]"/>
+ <property name="message" value="Space needed before opening parenthesis."/>
+ </module>
+
+ <!-- For each spacing -->
+ <module name="RegexpSingleline">
+ <property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
+ <property name="message" value="Space needed around ':' character."/>
+ </module>
+
<module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
@@ -51,20 +63,20 @@
<module name="LineLength">
<property name="max" value="100"/>
</module>
- <!--module name="MethodLength"/-->
+ <module name="MethodLength"/>
<!--module name="ParameterNumber"/-->
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="GenericWhitespace"/>
- <!--<module name="EmptyForIteratorPad"/>-->
+ <module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
- <!--module name="TypecastParenPad"/-->
+ <module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
2  compiler/src/main/java/dagger/internal/codegen/JavaWriter.java
View
@@ -227,7 +227,7 @@ public void beginMethod(String returnType, String name, int modifiers, String...
type(name);
}
out.write("(");
- for (int p = 0; p < parameters.length; ) {
+ for (int p = 0; p < parameters.length;) {
if (p != 0) {
out.write(", ");
}
Please sign in to comment.
Something went wrong with that request. Please try again.