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

Unified Diff: checkstyle/java/rules/mozilla_checks.xml

Issue 29567648: Issue 4248 - Add codestyle check
Patch Set: Created Oct. 6, 2017, 11:27 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: checkstyle/java/rules/mozilla_checks.xml
diff --git a/checkstyle/java/rules/mozilla_checks.xml b/checkstyle/java/rules/mozilla_checks.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a9219e846f1c6c2690ae9ddfa5533664cb748d53
--- /dev/null
+++ b/checkstyle/java/rules/mozilla_checks.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+
+ https://github.com/mozilla-services/mozilla-style/blob/master/java/checkstyle.xml
+
+ This file contains a Checkstyle configuration that checks for compliance with
+ Mozilla's Java style conventions.
+
+ The file defines the modules and properties in alpabetical order. Each property
+ should be documented with what it does.
+
+-->
+
+<module name="Checker">
+ <module name="TreeWalker">
+
+ <!-- Annotations. http://checkstyle.sourceforge.net/config_annotation.html -->
+ <module name="AnnotationUseStyle"/>
+ <module name="MissingDeprecated"/>
+ <module name="MissingOverride"/>
+ <module name="SuppressWarnings"/>
+
+ <!-- Block checks. See http://checkstyle.sourceforge.net/config_blocks.html -->
+ <module name="AvoidNestedBlocks"/>
+ <module name="EmptyBlock"/>
+ <module name="LeftCurly"/>
+ <module name="NeedBraces"/>
+ <module name="RightCurly"/>
+
+ <!-- Class Design. http://checkstyle.sourceforge.net/config_design.html -->
+ <module name="DesignForExtension"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="InnerTypeLast"/>
+ <module name="MutableException"/>
+ <module name="VisibilityModifier"/>
+
+ <!-- Common coding problems. See http://checkstyle.sf.net/config_coding.html -->
+ <module name="ArrayTrailingComma"/>
+ <module name="CovariantEquals"/>
+ <module name="DeclarationOrder"/>
+ <module name="DefaultComesLast"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="EqualsAvoidNull"/>
+ <module name="ExplicitInitialization"/>
+ <module name="HiddenField"/>
+ <module name="IllegalCatch"/>
+ <module name="IllegalInstantiation"/>
+ <module name="IllegalThrows"/>
+ <module name="IllegalToken"/>
+ <module name="IllegalType"/>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber"/>
+ <module name="MissingCtor"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="ModifiedControlVariable"/>
+ <module name="MultipleStringLiterals"/>
+ <module name="MultipleVariableDeclarations"/>
+ <module name="NestedForDepth"/>
+ <module name="NoClone"/>
+ <module name="NoFinalizer"/>
+ <module name="OneStatementPerLine"/>
+ <module name="PackageDeclaration"/>
+ <module name="ParameterAssignment"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="StringLiteralEquality"/>
+ <module name="UnnecessaryParentheses"/>
+
+ <!-- Duplicate code. http://checkstyle.sourceforge.net/config_duplicates.html -->
+
+ <!-- Header. See http://checkstyle.sourceforge.net/config_header.html -->
+ <!-- TODO detect MPL 2.0 in all files. -->
+
+ <!-- Imports. See http://checkstyle.sf.net/config_import.html -->
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/>
+ <module name="ImportOrder">
+ <!-- Android's import guidelines: http://source.android.com/source/code-style.html#order-import-statements -->
+ <property name="groups" value="android,ch,com,net,org,java,javax"/>
+ <property name="separated" value="true"/>
+ </module>
+ <module name="AvoidStaticImport"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+ <!-- Javadoc. See http://checkstyle.sourceforge.net/config_javadoc.html -->
+ <module name="JavadocMethod"/>
+ <module name="JavadocStyle"/>
+ <module name="JavadocType"/>
+ <module name="JavadocVariable"/>
+
+ <!-- Metrics. See http://checkstyle.sourceforge.net/config_metrics.html -->
+
+ <!-- Miscellaneous. See http://checkstyle.sourceforge.net/config_misc.html -->
+ <module name="ArrayTypeStyle"/>
+ <module name="Indentation"/>
+ <module name="OuterTypeFilename"/>
+ <module name="TodoComment">
+ <property name="format" value="FIX ?ME|TO-?DO|XXX"/>
+ </module>
+ <module name="UpperEll"/>
+
+ <!-- Modifiers. See http://checkstyle.sourceforge.net/config_modifier.html -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+ <!-- Naming Conventions. See http://checkstyle.sourceforge.net/config_naming.html -->
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName">
+ <!-- We require member names to be prefixed with 'm'. -->
+ <property name="format" value="^m[A-Z][a-zA-Z0-9]*$" />
+ </module>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName">
+ <!-- We require static member names to be prefixed with 's'. -->
+ <property name="format" value="^s[A-Z][a-zA-Z0-9]*$" />
+ </module>
+ <module name="TypeName"/>
+
+ <!-- Regular expressions. See http://checkstyle.sourceforge.net/config_regexp.html -->
+
+ <!-- Size violations. See http://checkstyle.sourceforge.net/config_sizes.html -->
+ <module name="AnonInnerLength"/>
+ <module name="LineLength">
+ <property name="max" value="100" />
+ </module>
+ <module name="MethodCount"/>
+ <module name="MethodLength"/>
+ <module name="OuterTypeNumber"/>
+ <module name="ParameterNumber"/>
+
+ <!-- Whitespace. See http://checkstyle.sourceforge.net/config_whitespace.html -->
+ <module name="EmptyForInitializerPad"/>
+ <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"/>
+
+ </module>
+
+ <module name="FileLength"/>
+
+ <module name="FileTabCharacter">
+ <property name="eachLine" value="true"/>
+ </module>
+
+ <module name="NewlineAtEndOfFile"/>
+
+ <module name="RegexpSingleline">
+ <!-- Check for trailing whitespace. -->
+ <property name="format" value="\s+$"/>
+ <property name="message" value="Line has trailing spaces."/>
+ </module>
+
+</module>

Powered by Google App Engine
This is Rietveld