Diederik has uploaded a new change for review. https://gerrit.wikimedia.org/r/78960
Change subject: Add Maven Checkstyle ...................................................................... Add Maven Checkstyle Change-Id: I8ad7109f8fa62441cafbe48df0897a2f1c8e084c --- A checkstyle.xml M pom.xml 2 files changed, 141 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/kraken refs/changes/60/78960/1 diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 0000000..c60c940 --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,135 @@ +<?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"> + + <!-- Checks whether files end with a new line. --> + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> + <module name="NewlineAtEndOfFile" /> + + <!-- Checks that property files contain the same keys. --> + <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> + <module name="Translation" /> + <module name="FileLength" /> + + <module name="TreeWalker"> + <!-- Checks for Javadoc comments. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html --> + <module name="JavadocMethod"> + <property name="scope" value="protected" /> + </module> + <module name="JavadocType"> + <property name="scope" value="protected" /> + <property name="allowUnknownTags" value="true"/> + </module> + <module name="JavadocVariable"> + <property name="scope" value="protected" /> + </module> + <module name="JavadocStyle"> + <property name="scope" value="protected" /> + </module> + + <!-- Checks for Naming Conventions. --> + <!-- See http://checkstyle.sf.net/config_naming.html --> + <module name="ConstantName" /> + <module name="LocalFinalVariableName" /> + <module name="LocalVariableName" /> + <module name="MemberName" > + <property name="format" value="^[_a-z][a-zA-Z0-9]*$"/> + </module> + <module name="MethodName" /> + <module name="PackageName" /> + <module name="ParameterName" /> + <module name="StaticVariableName" > + <property name="format" value="^[_a-z][a-zA-Z0-9]*$"/> + </module> + <module name="TypeName" /> + + <!-- Checks for imports --> + <!-- See http://checkstyle.sf.net/config_import.html --> + <module name="AvoidStarImport" /> + <module name="IllegalImport" /> <!-- defaults to sun.* packages --> + <module name="RedundantImport" /> + <module name="UnusedImports" /> + + + <!-- Checks for Size Violations. --> + <!-- See http://checkstyle.sf.net/config_sizes.html --> + <!-- <module name="LineLength" > --> + <!-- <property name="max" value="160"/> --> + <!-- </module> --> + <module name="MethodLength" /> + <module name="ParameterNumber" /> + + + <!-- Checks for whitespace --> + <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <module name="EmptyForIteratorPad"> + <property name="option" value="space" /> + </module> + <module name="MethodParamPad" /> + <module name="NoWhitespaceAfter" /> + <module name="NoWhitespaceBefore" /> + <module name="OperatorWrap" /> + <module name="ParenPad" /> + <module name="TypecastParenPad" /> + <!-- <module name="TabCharacter"/> --> + <module name="WhitespaceAfter" /> + <module name="WhitespaceAround" /> + + + <!-- Modifier Checks --> + <!-- See http://checkstyle.sf.net/config_modifiers.html --> + <module name="ModifierOrder" /> + <module name="RedundantModifier" /> + + + <!-- Checks for blocks. You know, those {}'s --> + <!-- See http://checkstyle.sf.net/config_blocks.html --> + <module name="AvoidNestedBlocks" /> + <module name="EmptyBlock" /> + <module name="LeftCurly" /> + <module name="NeedBraces" /> + <module name="RightCurly" /> + + + <!-- Checks for common coding problems --> + <!-- See http://checkstyle.sf.net/config_coding.html --> + <module name="AvoidInlineConditionals" /> + <module name="DoubleCheckedLocking" /> <!-- MY FAVOURITE --> + <module name="EmptyStatement" /> + <module name="EqualsHashCode" /> + <module name="HiddenField" /> + <module name="IllegalInstantiation" /> + <module name="InnerAssignment" /> + <module name="MagicNumber" /> + <module name="MissingSwitchDefault" /> + <module name="RedundantThrows" /> + <module name="SimplifyBooleanExpression" /> + <module name="SimplifyBooleanReturn" /> + + <!-- Checks for class design --> + <!-- See http://checkstyle.sf.net/config_design.html --> + <!-- <module name="DesignForExtension"/> --> + <module name="FinalClass" /> + <!-- <module name="HideUtilityClassConstructor"/> --> + <module name="InterfaceIsType" /> + <module name="VisibilityModifier" /> + + + <!-- Miscellaneous other checks. --> + <!-- See http://checkstyle.sf.net/config_misc.html --> + <!-- <module name="ArrayTypeStyle"/> --> + <!-- <module name="FinalParameters"/> --> + <module name="TodoComment" /> + <module name="UpperEll" /> + + <!-- Optional Checks --> + <!-- <module name="usage.OneMethodPrivateField" /> --> + <!-- <module name="usage.UnusedLocalVariable" /> --> + <!-- <module name="usage.UnusedParameter" /> --> + + </module> + +</module> diff --git a/pom.xml b/pom.xml index e87ae1c..6a0778d 100644 --- a/pom.xml +++ b/pom.xml @@ -141,6 +141,12 @@ </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.10</version> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> -- To view, visit https://gerrit.wikimedia.org/r/78960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ad7109f8fa62441cafbe48df0897a2f1c8e084c Gerrit-PatchSet: 1 Gerrit-Project: analytics/kraken Gerrit-Branch: master Gerrit-Owner: Diederik <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
