Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the appropriate version of the Google java style from the checkstyle Github repo.For example, the configuration file for checkstyle version 8.32 here.
  2. Change the maximum line length in the LineLength directive to 120 characters

    Code Block
    languagexml
    <module name="LineLength">
        <property name="fileExtensions" value="java" />
    	<property name="max" value="120" />
    	<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
    </module>


  3. Change the indentation in the Indentation directive to 2 4 spaces

    Code Block
    languagexml
    <module name="Indentation">
    	<property name="basicOffset" value="4" />
    	<property name="braceAdjustment" value="0" />
    	<property name="caseIndent" value="4" />
    	<property name="throwsIndent" value="4" />
    	<property name="lineWrappingIndentation" value="4" />
    	<property name="arrayInitIndent" value="4" />
    </module>


  4. Change the MissingJavadocMethod directive to Ignore missing Javadoc on test methods

    Code Block
    languagexml
    <module name="MissingJavadocMethod">
    	<property name="scope" value="public" />
    	<property name="minLineCount" value="2" />
    	<property name="allowedAnnotations" value="Override, Test" />
    	<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF" />
    	<property name="ignoreMethodNamesRegex" value="^(test|before|after)[a-zA-Z0-9_]*$" />
    </module>


...