Skip to content

Instantly share code, notes, and snippets.

@adavis
Created June 22, 2015 20:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adavis/a9ee4f210b9163ff3e96 to your computer and use it in GitHub Desktop.
Save adavis/a9ee4f210b9163ff3e96 to your computer and use it in GitHub Desktop.
Checkstyle configuration for use in Android projects.
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="FileLength"><property name="max" value="800"/></module>
<module name="TreeWalker">
<module name="MethodLength"><property name="max" value="60"/></module>
<module name="LineLength"><property name="max" value="180"/></module>
<module name="ParameterNumber"><property name="max" value="8"/></module>
<module name="CyclomaticComplexity"><property name="max" value="10"/></module>
<module name="NestedIfDepth"><property name="max" value="3"/></module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="MethodName"/>
<module name="PackageName"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad" />
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoWhitespaceAfter" />
<module name="NoWhitespaceBefore" />
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround" />
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="NeedBraces"/>
<module name="FileContentsHolder"/> <!-- Required by comment suppression filters -->
</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>
<module name="RegexpMultiline">
<property name="format" value="\r?\n[ \t\x0B\f]*\r?\n[ \t\x0B\f]*\r?\n"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Two consecutive empty lines"/>
</module>
<module name="SuppressionCommentFilter"/>
</module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment