OSDN Git Service

move style XMLs
authorOlyutorskii <olyutorskii@users.osdn.me>
Fri, 7 Apr 2017 14:48:51 +0000 (23:48 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Fri, 7 Apr 2017 14:48:51 +0000 (23:48 +0900)
checkstyle-suppressions.xml [moved from src/main/config/suppressions.xml with 71% similarity]
checkstyle.xml [moved from src/main/config/checks.xml with 70% similarity]
pmdrules.xml [moved from src/main/config/pmdrules.xml with 63% similarity]
pom.xml

similarity index 71%
rename from src/main/config/suppressions.xml
rename to checkstyle-suppressions.xml
index f1500fa..b70b7fe 100644 (file)
@@ -5,8 +5,8 @@
     "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
 
 <!--
-    Checkstyle用警告抑止設定
-    ※ SuppressionFilter モジュール用
+    Checkstyle suppressions
+    for Checkstyle 6.19(7.4) or later
 
     [ http://checkstyle.sourceforge.net/ ]
 
     <!-- Imports -->
     <suppress files="" checks="ImportControl" />
 
-    <!-- Javadoc Comments -->
-    <suppress files="" checks="SummaryJavadocCheck" />
-        <!-- 句読点対応待ち -->
-    <suppress files="" checks="SingleLineJavadoc" />
-        <!-- ignoredTagsプロパティ対応待ち -->
-
     <!-- Miscellaneous -->
     <suppress files="" checks="FinalParameters" />
     <suppress files="" checks="TrailingComment" />
 
+    <!-- Whitespace -->
+    <suppress files="" checks="SingleSpaceSeparator" />
+
 </suppressions>
 
 
similarity index 70%
rename from src/main/config/checks.xml
rename to checkstyle.xml
index bad583f..951ea00 100644 (file)
@@ -5,9 +5,8 @@
     "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
 
 <!--
-    Checkstyle用チェック項目定義。
-
-    Checkstyle 6.1 以降向けに記述。
+    Checkstyle modules
+    for Checkstyle 6.19(7.4) or later
 
     [ http://checkstyle.sourceforge.net/ ]
 
 
     <property name="charset" value="UTF-8" />
     <property name="localeCountry" value="JP" />
-    <property name="localeLanguage" value="ja" />
+    <property name="localeLanguage" value="en" />
+    <!--property name="localeLanguage" value="ja" /-->
+    <property name="fileExtensions" value="java, xml, properties" />
     <property name="severity" value="error" />
 
 
     <!-- Filters -->
     <module name="SeverityMatchFilter" />
     <module name="SuppressionCommentFilter" />
-    <module name="SuppressionFilter">
-        <property name="file" value="src/main/config/suppressions.xml" />
-    </module>
+    <module name="SuppressionFilter" />
     <module name="SuppressWarningsFilter" />
     <module name="SuppressWithNearbyCommentFilter" />
 
 
     <!-- Headers -->
+    <module name="Header">
+        <property name="header" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;" />
+        <property name="fileExtensions" value="xml" />
+    </module>
     <module name="RegexpHeader">
         <property name="header" value="^/\*$\n^ \*( .*)?$\n^ \*/$\n" />
         <property name="multiLines" value="2" />
@@ -57,7 +60,7 @@
     <module name="RegexpMultiline">
         <property name="format" value="[\u000b\f\u001a]" />
     </module>
-<!--<module name="RegexpOnFilename" />   6.15 or later -->
+    <module name="RegexpOnFilename" />
     <module name="RegexpSingleline">
         <property name="format" value="\s+$" />
     </module>
@@ -68,9 +71,7 @@
 
 
     <!-- Size Violations -->
-    <module name="FileLength">
-        <property name="max" value="2000"/>
-    </module>
+    <module name="FileLength" />
 
 
     <!-- Whitespace -->
@@ -80,6 +81,7 @@
     <module name="TreeWalker">
 
         <property name="tabWidth" value="8"/>
+        <property name="fileExtensions" value="java"/>
 
 
     <!-- Annotations -->
 
 
     <!-- Block Checks -->
+
         <module name="AvoidNestedBlocks" />
         <module name="EmptyBlock" />
-<!--    <module name="EmptyCatchBlock" />  6.4 or later  -->
+        <module name="EmptyCatchBlock" />
         <module name="LeftCurly" />
         <module name="NeedBraces">
-            <property name="tokens" value="LITERAL_DO" />
+            <property name="allowSingleLineStatement" value="true" />
         </module>
         <module name="RightCurly" />
 
         <module name="InterfaceIsType" />
         <module name="MutableException" />
         <module name="OneTopLevelClass" />
-        <module name="ThrowsCount">
-            <property name="max" value="4" />
-        </module>
+        <module name="ThrowsCount" />
         <module name="VisibilityModifier" />
 
 
         <module name="HiddenField">
             <property name="ignoreConstructorParameter" value="true" />
             <property name="ignoreSetter" value="true" />
+            <property name="setterCanReturnItsClass" value="true" />
             <property name="ignoreAbstractMethods" value="true" />
         </module>
         <module name="IllegalCatch" />
         <module name="IllegalToken">
             <property name="tokens" value="LITERAL_NATIVE" />
         </module>
-        <module name="IllegalTokenText">
-            <property name="tokens" value="NUM_INT, NUM_LONG" />
-            <property name="format" value="^0_*[0-7]" />
-            <property name="message" value="inhibit octal number" />
-        </module>
+        <module name="IllegalTokenText" />
         <module name="IllegalType" />
         <module name="InnerAssignment" />
         <module name="MagicNumber" />
         <module name="ModifiedControlVariable" />
         <module name="MultipleStringLiterals" />
         <module name="MultipleVariableDeclarations" />
-        <module name="SimplifyBooleanExpression" />
-        <module name="SimplifyBooleanReturn" />
-        <module name="StringLiteralEquality" />
         <module name="NestedForDepth" />
         <module name="NestedIfDepth" />
         <module name="NestedTryDepth" />
         <module name="PackageDeclaration" />
         <module name="ParameterAssignment" />
         <module name="RequireThis">
-            <property name="checkMethods" value="false" />
-        </module>
-        <module name="ReturnCount">
-            <property name="max" value="5" />
+            <!--property name="checkMethods" value="false" /-->
         </module>
+        <module name="ReturnCount" />
         <module name="SimplifyBooleanExpression" />
         <module name="SimplifyBooleanReturn" />
         <module name="StringLiteralEquality" />
         <module name="SuperClone" />
         <module name="SuperFinalize" />
         <module name="UnnecessaryParentheses" />
-        <module name="VariableDeclarationUsageDistance">
-            <property name="allowedDistance" value="5" />
-        </module>
+        <module name="VariableDeclarationUsageDistance" />
 
 
     <!-- Imports -->
             <property name="allowIfAllCharactersEscaped" value="true"/>
             <property name="allowNonPrintableEscapes" value="true"/>
         </module>
-<!--    <module name="CommentsIndentation" />  6.10 or later  -->
+        <module name="CommentsIndentation" />
         <module name="DescendantToken" />
         <module name="FileContentsHolder" />
         <module name="FinalParameters" />
     <!-- Naming Conventions -->
 
         <module name="AbbreviationAsWordInName" />
-        <module name="AbstractClassName">
-            <property
-                name="format"
-                value="^Abstract.*$|^.*Factory$|^.*Builder$|^.*Adapter$"
-            />
-        </module>
-<!--    <module name="CatchParameterName" />    6.14 or later -->
+        <module name="AbstractClassName" />
+        <module name="CatchParameterName" />
         <module name="ClassTypeParameterName" />
         <module name="ConstantName" />
         <module name="InterfaceTypeParameterName" />
-        <module name="LocalFinalVariableName">
-            <property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
-        </module>
-        <module name="LocalVariableName">
-            <property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
-        </module>
-        <module name="MemberName">
-            <property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
-        </module>
+        <module name="LocalFinalVariableName" />
+        <module name="LocalVariableName" />
+        <module name="MemberName" />
         <module name="MethodName" />
         <module name="MethodTypeParameterName" />
         <module name="PackageName" />
-        <module name="ParameterName">
-            <property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
-        </module>
-        <module name="StaticVariableName">
-            <property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
-        </module>
+        <module name="ParameterName" />
+        <module name="StaticVariableName" />
         <module name="TypeName" />
 
 
             />
         </module>
         <module name="GenericWhitespace" />
-        <module name="MethodParamPad">
-            <property
-                name="tokens"
-                value="CTOR_DEF, LITERAL_NEW, METHOD_DEF, SUPER_CTOR_CALL"
-            />
-        </module>
+        <module name="MethodParamPad" />
         <module name="NoLineWrap" />
-        <module name="NoWhitespaceAfter">
-            <property name="allowLineBreaks" value="false" />
-            <property name="tokens" value="INC, DEC, DOT" />
-        </module>
-        <module name="NoWhitespaceBefore">
-            <property name="allowLineBreaks" value="false" />
-            <property name="tokens" value="COMMA, POST_INC, POST_DEC" />
-        </module>
-        <module name="NoWhitespaceBefore">
-            <property name="allowLineBreaks" value="true" />
-            <property name="tokens" value="SEMI" />
-        </module>
-        <module name="OperatorWrap">
-            <property name="option" value="eol" />
-            <property
-                name="tokens"
-                value="ASSIGN,
-                       BAND_ASSIGN, BOR_ASSIGN, BXOR_ASSIGN,
-                       PLUS_ASSIGN, MINUS_ASSIGN,
-                       STAR_ASSIGN, DIV_ASSIGN, MOD_ASSIGN,
-                       SL_ASSIGN, SR_ASSIGN, BSR_ASSIGN"
-            />
-        </module>
-        <module name="OperatorWrap">
-            <property name="option" value="nl" />
-            <property
-                name="tokens"
-                value="QUESTION,
-                       BAND, BOR, BXOR,
-                       PLUS, MINUS, STAR, DIV, MOD,
-                       LAND, LOR,
-                       EQUAL, NOT_EQUAL"
-            />
-        </module>
-        <module name="ParenPad">
-            <property name="option" value="nospace" />
-            <property
-                name="tokens"
-                value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL"
-            />
-        </module>
-        <module name="SeparatorWrap">
-            <property name="tokens" value="DOT" />
-            <property name="option" value="nl" />
-        </module>
+        <module name="NoWhitespaceAfter" />
+        <module name="NoWhitespaceBefore" />
+        <module name="OperatorWrap" />
+        <module name="ParenPad" />
+        <module name="SeparatorWrap" />
+        <module name="SingleSpaceSeparator" />
         <module name="TypecastParenPad" />
-        <module name="WhitespaceAfter" />
+        <module name="WhitespaceAfter" >
+            <property name="tokens" value="COMMA, SEMI,"/>
+        </module>
         <module name="WhitespaceAround">
             <property
                 name="tokens"
 
     </module>
 
+
 </module>
 
 <!-- EOF -->
similarity index 63%
rename from src/main/config/pmdrules.xml
rename to pmdrules.xml
index 9c10f91..a5daf84 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 
 <!--
-    PMD用ルールセット定義
-
-    PMD [ https://pmd.github.io/ ] 5.3 以降用に記述されています。
+    Custom rule set
+    for PMD [ https://pmd.github.io/ ] 5.5.2 or later
 
     Copyright(c) 2016 olyutorskii
 -->
 >
 
     <description>
-        custom rulesets for project
+        custom rulesets
     </description>
 
-<!--
     <rule ref="rulesets/java/android.xml" />
--->
 
     <rule ref="rulesets/java/basic.xml" />
 
 
     <rule ref="rulesets/java/clone.xml" />
 
-    <rule ref="rulesets/java/codesize.xml">
-        <exclude name="TooManyMethods" />
-    </rule>
-    <rule ref="rulesets/java/codesize.xml/TooManyMethods">
-        <properties>
-            <property name="maxmethods" value="25"/>
-        </properties>
-    </rule>
+    <rule ref="rulesets/java/codesize.xml" />
 
-    <rule ref="rulesets/java/comments.xml">
-        <exclude name="CommentRequired" />
-        <exclude name="CommentSize" />
-    </rule>
+    <rule ref="rulesets/java/comments.xml" />
     <rule ref="rulesets/java/comments.xml/CommentRequired" >
         <properties>
             <property name="fieldCommentRequirement" value="Ignored"/>
     </rule>
 
     <rule ref="rulesets/java/controversial.xml">
-        <exclude name="NullAssignment" />
         <exclude name="OnlyOneReturn" />
-        <exclude name="DefaultPackage" />
         <exclude name="DataflowAnomalyAnalysis" />
-        <exclude name="AvoidUsingShortType" />
         <exclude name="AvoidLiteralsInIfCondition" />
-        <exclude name="UseConcurrentHashMap" />
     </rule>
 
     <rule ref="rulesets/java/coupling.xml">
     </rule>
 
     <rule ref="rulesets/java/design.xml">
-        <exclude name="SimplifyBooleanReturns" />
-        <exclude name="ConfusingTernary" />
         <exclude name="UnnecessaryLocalBeforeReturn" />
-        <exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
     </rule>
 
     <rule ref="rulesets/java/empty.xml" />
 
     <rule ref="rulesets/java/imports.xml" />
 
-<!--
     <rule ref="rulesets/java/j2ee.xml" />
-    <rule ref="rulesets/java/javabeans.xml" />
--->
-
-    <rule ref="rulesets/java/junit.xml" />
 
-<!--
     <rule ref="rulesets/java/logging-jakarta-commons.xml" />
--->
+
+    <rule ref="rulesets/java/javabeans.xml">
+        <exclude name="BeanMembersShouldSerialize" />
+    </rule>
 
     <rule ref="rulesets/java/logging-java.xml" />
 
+    <rule ref="rulesets/java/junit.xml" />
+
     <rule ref="rulesets/java/migrating.xml" />
-<!--
-    <rule ref="rulesets/java/migrating_to_XX.xml" />
--->
 
     <rule ref="rulesets/java/naming.xml">
         <exclude name="ShortVariable" />
-        <exclude name="LongVariable" />
-        <exclude name="AvoidFieldNameMatchingMethodName" />
-    </rule>
-    <rule ref="rulesets/java/naming.xml/LongVariable">
-        <properties>
-            <property name="minimum" value="25"/>
-        </properties>
     </rule>
 
     <rule ref="rulesets/java/optimizations.xml">
         <exclude name="RedundantFieldInitializer" />
     </rule>
 
-    <rule ref="rulesets/java/strictexception.xml">
-        <exclude name="AvoidThrowingNullPointerException" />
-    </rule>
+    <rule ref="rulesets/java/strictexception.xml" />
 
     <rule ref="rulesets/java/strings.xml" />
 
 
     <rule ref="rulesets/java/unnecessary.xml">
         <exclude name="UnnecessaryReturn" />
-        <exclude name="UselessParentheses" />
     </rule>
 
     <rule ref="rulesets/java/unusedcode.xml" />
diff --git a/pom.xml b/pom.xml
index f990a50..3b94d86 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <findbugs.jvmArgs>-Duser.language=en</findbugs.jvmArgs>
 
         <jacoco-plugin.version>0.7.9</jacoco-plugin.version>
-        <project.mainconf>${project.basedir}/src/main/config</project.mainconf>
 
         <checkstyle-plugin.version>2.17</checkstyle-plugin.version>
         <checkstyleruntime.version>6.19</checkstyleruntime.version>
-        <checkstyle.config.location>${project.mainconf}/checks.xml</checkstyle.config.location>
+        <checkstyle.config.location>${project.basedir}/checkstyle.xml</checkstyle.config.location>
+        <checkstyle.suppressions.location>${project.basedir}/checkstyle-suppressions.xml</checkstyle.suppressions.location>
         <checkstyle.enable.rss>false</checkstyle.enable.rss>
 
         <pmd-plugin.version>3.7</pmd-plugin.version>
                 <version>${pmd-plugin.version}</version>
                 <configuration>
                     <rulesets>
-                        <ruleset>${project.mainconf}/pmdrules.xml</ruleset>
+                        <ruleset>${project.basedir}/pmdrules.xml</ruleset>
                     </rulesets>
                 </configuration>
                 <reportSets>