[CheckStyle] Como ignorar um Determinado Pacote?

0 respostas
I

Pessoa,
Nunca mechi com CheckStyle, porém agora devo utilizar e gostaria que ele “Não” valida-se as classes de um determinado pacote: "com.porto.vidacrm.integration.helper"
Olhei no google algo sobre adicionar isso: " " ao arquivo, porém não adiantou.

Alguém pode me ajudar a fazer o CheckStyle ignorar o pacote que eu queira?

Segue abaixo o arquivo de configuração do CheckStyle.

Att,
Diogo Barbosa.

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-configurations file-format-version="3.2.0">
    <check-configuration name="PortoSeguro_CheckStyle_Config">
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck" severity="ignore">
            <config-properties>
                <config-property name="javaStyle" value="true"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck" severity="error">
            <config-properties>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.GenericIllegalRegexpCheck" severity="ignore">
            <config-properties>
                <config-property name="format" value="\s+$"/>
                <config-property name="ignoreCase" value="false"/>
                <config-property name="message" value="Line has trailing spaces."/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.ModifierOrderCheck" severity="info">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.RedundantModifierCheck" severity="ignore">
            <config-properties>
                <config-property name="tokens" value="METHOD_DEF, VARIABLE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck" severity="ignore">
            <config-properties>
                <config-property name="format" value="TODO:"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck" severity="error">
            <config-properties>
                <config-property name="allowInSwitchCase" value="false"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck" severity="error">
            <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" severity="error">
            <config-properties>
                <config-property name="maxLineLength" value="130"/>
                <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="error">
            <config-properties>
                <config-property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_IF, LITERAL_FOR, LITERAL_WHILE"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck" severity="error">
            <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.AvoidInlineConditionalsCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.DoubleCheckedLockingCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck" severity="error">
            <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="ignore">
            <config-properties>
                <config-property name="ignoreConstructorParameter" value="false"/>
                <config-property name="ignoreSetter" value="false"/>
                <config-property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck" severity="error">
            <config-properties>
                <config-property name="classes" value="{}"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck" severity="error">
            <config-properties>
                <config-property name="tokens" value="ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN, BXOR_ASSIGN, DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, SR_ASSIGN, STAR_ASSIGN"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck" severity="warning">
            <config-properties>
                <config-property name="ignoreNumbers" value="-1, 0, 1, 2"/>
                <config-property name="tokens" value="NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck" severity="error">
            <config-properties>
                <config-property name="allowSubclasses" value="false"/>
                <config-property name="allowUnchecked" value="false"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck" severity="ignore">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck" severity="error">
            <config-properties>
                <config-property name="allowMarkerInterfaces" value="true"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck" severity="error">
            <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.AvoidStarImportCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck" severity="error">
            <config-properties>
                <config-property name="illegalPkgs" value="sun"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck" severity="error">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck" severity="error">
            <config-properties>
                <config-property name="allowMissingParamTags" value="false"/>
                <config-property name="allowMissingReturnTag" value="true"/>
                <config-property name="allowMissingThrowsTags" value="false"/>
                <config-property name="allowThrowsTagsForSubclasses" value="false"/>
                <config-property name="allowUndeclaredRTE" value="false"/>
                <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.JavadocTypeCheck" severity="error">
            <config-properties>
                <config-property name="scope" value="private"/>
                <config-property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck" severity="ignore">
            <config-properties>
                <config-property name="scope" value="private"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck" severity="error">
            <config-properties>
                <config-property name="max" value="15"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[A-Z](_?[A-Z0-9]+)*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck" severity="error">
            <config-properties>
                <config-property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
                <config-property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck" severity="error">
            <config-properties>
                <config-property name="max" value="2000"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck" severity="error">
            <config-properties>
                <config-property name="ignorePattern" value="^$"/>
                <config-property name="max" value="130"/>
                <config-property name="tabWidth" value="4"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck" severity="error">
            <config-properties>
                <config-property name="countEmpty" value="true"/>
                <config-property name="max" value="130"/>
                <config-property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck" 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="ignore">
            <config-properties>
                <config-property name="option" value="nospace"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck" severity="ignore">
            <config-properties>
                <config-property name="allowLineBreaks" value="true"/>
                <config-property name="tokens" value="ARRAY_INIT, BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck" severity="ignore">
            <config-properties>
                <config-property name="allowLineBreaks" value="true"/>
                <config-property name="tokens" value="SEMI, POST_DEC, POST_INC"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck" severity="info">
            <config-properties>
                <config-property name="option" value="nl"/>
                <config-property name="tokens" value="BAND, BOR, BSR, BXOR, COLON, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck" severity="ignore">
            <config-properties>
                <config-property name="option" value="nospace"/>
                <config-property name="tokens" value="CTOR_CALL, LPAREN, METHOD_CALL, RPAREN, SUPER_CTOR_CALL"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.TabCharacterCheck" severity="ignore">
            <config-properties/>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck" severity="ignore">
            <config-properties>
                <config-property name="tokens" value="COMMA, SEMI, TYPECAST"/>
            </config-properties>
        </rule-configuration>
        <rule-configuration
            classname="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck" severity="ignore">
            <config-properties>
                <config-property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, 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, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
            </config-properties>
        </rule-configuration>
    </check-configuration>
</checkstyle-configurations>
Criado 24 de maio de 2012
Respostas 0
Participantes 1