简体   繁体   中英

How to add exactly one tab before method in googles checkstyle.xml

so I want maven checkstyle plugin build to fail when one method is more than one tab in (4 spaces) simple example is

class test {
    public void test1 () {} //4 spaces in so thats ok
     public void test2 () {} //5 spaces in i want maven build to fail
}

I can't find someone that has a solution to this problem so I need help

Solved add under TreeWalker this

<module name="Indentation">
        <property name="basicOffset" value="4"/>
        <property name="braceAdjustment" value="0"/>
        <property name="caseIndent" value="4"/>
        <property name="throwsIndent" value="8"/>
        <property name="lineWrappingIndentation" value="8"/>
        <property name="arrayInitIndent" value="4"/>
    </module>

that's how I fixed my problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM