如何在googles checkstyle.xml中的方法前添加一个选项卡

问题描述 投票:1回答:1

所以我希望maven checkstyle插件构建失败,当一个方法是多个选项卡(4个空格)时,简单的例子是

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

我找不到能解决这个问题的人,所以我需要帮助

java maven checkstyle maven-checkstyle-plugin
1个回答
1
投票

解决了在TreeWalker下添加的问题

<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>

这就是我解决问题的方法

© www.soinside.com 2019 - 2024. All rights reserved.