...
- 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.
Change the maximum line length in the LineLength directive to 120 characters
Code Block language xml <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>
Change the indentation in the Indentation directive to 2 spaces
Code Block language xml <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>
Change the MissingJavadocMethod directive to Ignore missing Javadoc on test methods
Code Block language xml <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>