eclipse的checkstyle模板

 
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-configurations file-format-version="3.2.0">
    <check-configuration name="Java-Branch Check">
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"
            comment="配列宣言" severity="warning">
            <config-properties>
                <config-property name="javaStyle" value="true"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.ModifierOrderCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck" severity="warning">
            <config-properties>
                <config-property name="option" value="stmt"/>
                <config-property name="tokens" value="LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, STATIC_INIT"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"
            comment=""{"について" severity="warning">
            <config-properties>
                <config-property name="maxLineLength" value="120"/>
                <config-property name="option" value="eol"/>
                <config-property name="tokens" value="CLASS_DEF, CTOR_DEF, INTERFACE_DEF, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"
            comment=""}"について" severity="warning">
            <config-properties>
                <config-property name="option" value="same"/>
                <config-property name="tokens" value="LITERAL_CATCH, LITERAL_ELSE, LITERAL_TRY"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.DoubleCheckedLockingCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck"
            comment="インスタンス化すべきではないクラス" severity="warning">
            <config-properties>
                <config-property name="classes" value="{}"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck" severity="warning">
            <config-properties>
                <config-property name="allowSubclasses" value="false"/>
                <config-property name="allowUnchecked" value="true"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"
            comment="boolean の冗長な比較の排除" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"
            comment="returnするboolean値の冗長性の排除" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck"
            comment="Stringの比較(String1 == String2を禁止) " severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"
            comment="クラスメンバのスコープ" severity="warning">
            <config-properties>
                <config-property name="packageAllowed" value="false"/>
                <config-property name="protectedAllowed" value="false"/>
                <config-property name="publicMemberPattern" value="^serialVersionUID"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"
            comment="使用禁止インポート" severity="warning">
            <config-properties>
                <config-property name="illegalPkgs" value="sun,java.lang.Thread,java.lang.Timer,java.lang.refrect"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"
            comment="メソッドコメント" severity="warning">
            <config-properties>
                <config-property name="allowMissingParamTags" value="false"/>
                <config-property name="allowMissingReturnTag" value="false"/>
                <config-property name="allowMissingThrowsTags" value="false"/>
                <config-property name="allowThrowsTagsForSubclasses" value="false"/>
                <config-property name="allowUndeclaredRTE" value="true"/>
                <config-property name="excludeScope" value="nothing"/>
                <config-property name="scope" value="private"/>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"
            comment="JavaDocの妥当性チェック TODO:checkEmptyJavaDoc" severity="warning">
            <config-properties>
                <config-property name="checkEmptyJavadoc" value="false"/>
                <config-property name="checkFirstSentence" value="false"/>
                <config-property name="checkHtml" value="true"/>
                <config-property name="scope" value="private"/>
                <config-property name="tokens" value="INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"
            comment="クラスコメント" severity="warning">
            <config-properties>
                <config-property name="authorFormat" value="\S"/>
                <config-property name="excludeScope" value="nothing"/>
                <config-property name="scope" value="private"/>
                <config-property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
                <config-property name="versionFormat" value="\S"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck"
            comment="クラス変数コメント" severity="warning">
            <config-properties>
                <config-property name="excludeScope" value="nothing"/>
                <config-property name="scope" value="private"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"
            comment="定数" severity="warning">
            <config-properties>
                <config-property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck"
            comment="ローカル変数" severity="warning">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"
            comment="public以外のメンバ" severity="warning">
            <config-properties>
                <config-property name="applyToPackage" value="true"/>
                <config-property name="applyToPrivate" value="true"/>
                <config-property name="applyToProtected" value="true"/>
                <config-property name="applyToPublic" value="false"/>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*_{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"
            comment="publicクラスメンバ" severity="warning">
            <config-properties>
                <config-property name="applyToPackage" value="false"/>
                <config-property name="applyToPrivate" value="false"/>
                <config-property name="applyToProtected" value="false"/>
                <config-property name="applyToPublic" value="true"/>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck"
            comment="メソッド名" severity="warning">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck"
            comment="パッケージ名" severity="warning">
            <config-properties>
                <config-property name="format" value="^jp\.co\.jcb\.jcb_host\.([a-z0-9]{3}|kuzilla)(\.[a-zA-Z_][a-zA-Z0-9_]*)*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck"
            comment="引数" severity="warning">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"
            comment="クラス変数" severity="warning">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*__{1}quot;/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck"
            comment="クラス名" severity="warning">
            <config-properties>
                <config-property name="format" value="^[A-Z][a-zA-Z0-9]*{1}quot;/>
                <config-property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck"
            comment="メソッド・コンストラクタ数" severity="warning">
            <config-properties>
                <config-property name="max" value="100"/>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck"
            comment="ファイルサイズ TODO:コメントはカウントされるのか。" severity="warning">
            <config-properties>
                <config-property name="max" value="1000"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"
            comment="一行の最大長" severity="warning">
            <config-properties>
                <config-property name="ignorePattern" value="^{1}quot;/>
                <config-property name="max" value="120"/>
                <config-property name="tabWidth" value="4"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck"
            comment="メソッドの最大行" severity="warning">
            <config-properties>
                <config-property name="countEmpty" value="false"/>
                <config-property name="max" value="250"/>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck"
            comment="パラメータ最大数" severity="warning">
            <config-properties>
                <config-property name="max" value="10"/>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck" severity="warning">
            <config-properties/>
        </rule-configuration>
    </check-configuration>
</checkstyle-configurations>


关于checkstyle的插件jar,请参照:

http://dl.dbank.com/c0bma9iicj

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值