Skip to content

Commit

Permalink
fix checkstyle config
Browse files Browse the repository at this point in the history
  • Loading branch information
don-vip committed Jun 30, 2018
1 parent 0f7aef1 commit 52754d5
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
</target>
<target name="checkstyle" depends="checkstyle-compile">
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpath="${checkstyle.jar}:${checkstyle-build.dir}"/>
<checkstyle config="${basedir}/../00_core_tools/checkstyle/josm_checks.xml">
<checkstyle config="${basedir}/../checkstyle-config.xml">
<fileset dir="${basedir}/src" includes="**/*.java" excludes="boofcv/**/*.java,
com/google/**/*.java,
crosby/**/*.java,
Expand Down
125 changes: 125 additions & 0 deletions checkstyle-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: JOSM
Description:
JOSM Checkstyle rules
-->
<module name="Checker">
<property name="severity" value="warning"/>
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<module name="BooleanExpressionComplexity">
<property name="max" value="8"/>
</module>
<module name="CatchParameterName">
<property name="format" value="^(e[1-9]?|t|ex[1-9]?|[a-z][a-z][a-zA-Z]+)$"/>
</module>
<module name="CommentsIndentation"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="PackageAnnotation"/>
<module name="AnnotationLocation">
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="AnnotationUseStyle"/>
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
<property name="checkHtml" value="false"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="AtclauseOrder"/>
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
<module name="AnonInnerLength">
<property name="max" value="50"/>
</module>
<module name="ExecutableStatementCount">
<property name="max" value="150"/>
<property name="tokens" value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/>
</module>
<module name="LineLength">
<property name="max" value="145"/>
<property name="tabWidth" value="4"/>
</module>
<module name="MethodLength">
<property name="max" value="300"/>
</module>
<module name="ParameterNumber">
<property name="max" value="10"/>
</module>
<module name="OuterTypeNumber"/>
<module name="GenericWhitespace"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="SingleSpaceSeparator"/>
<module name="MethodParamPad"/>
<module name="ParenPad"/>
<module name="TypecastParenPad">
<property name="tokens" value="RPAREN,TYPECAST"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
</module>
<module name="EmptyLineSeparator">
<property name="tokens" value="CLASS_DEF,ENUM_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF,STATIC_INIT"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>
</module>
<module name="EmptyBlock">
<property name="tokens" value="LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_DO,LITERAL_ELSE,LITERAL_FOR,INSTANCE_INIT,STATIC_INIT,LITERAL_SWITCH"/>
</module>
<module name="EmptyCatchBlock"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="NeedBraces">
<property name="tokens" value="LITERAL_DO,LITERAL_FOR,LITERAL_WHILE"/>
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="OuterTypeFilename"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="org.openstreetmap.josm.TopLevelJavadocCheck"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE\.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
</module>
<module name="Header">
<property name="header" value="// License: GPL. For details, see LICENSE file."/>
<property name="fileExtensions" value=".java"/>
</module>
<module name="FileLength">
<property name="fileExtensions" value=".java"/>
<property name="max" value="2500"/>
</module>
<module name="FileTabCharacter"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${basedir}/../checkstyle-filter.xml" default="checkstyle-filter.xml"/>
<property name="optional" value="true"/>
</module>
</module>
4 changes: 2 additions & 2 deletions checkstyle-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
<suppressions>
<suppress checks="HeaderCheck" files="../imagery_offset_db/**/*\.java" />
<suppress checks="HeaderCheck" files="../mapdust/**/*\.java" />
<suppress checks="HeaderCheck" files=".*(/|\\)imagery_offset_db(/|\\).*\.java" />
<suppress checks="HeaderCheck" files=".*(/|\\)mapdust(/|\\).*\.java" />
</suppressions>

0 comments on commit 52754d5

Please sign in to comment.