无法获取IntelliJ代码样式以匹配Checkstyle配置

时间:2019-04-18 00:08:31

标签: intellij-idea checkstyle

我正在为我正在处理的Java项目使用checkstyle,而我很满意checkstyle.xml。但是,我发现一个地方与我的IntelliJ代码样式规则不同。这是一个例子。

IntelliJ认为应采用以下格式:

thisIsALongFunctionWithMultipleParameters(parameter1,
        andHereIsASecondFunctionWithMultipleParameters(parameter1,
                parameter2));

但是,我的checkstyle失败了,似乎认为它应该像这样:

thisIsALongFunctionWithMultipleParameters(parameter1,
        andHereIsASecondFunctionWithMultipleParameters(parameter1,
        parameter2));

老实说,我并不在乎使用哪个,但我希望他们同意。这是我的checkstyle.xml的相关部分:

<module name="Indentation">
    <property name="lineWrappingIndentation" value="8" />     
    <property name="throwsIndent" value="8" />
    <property name="forceStrictCondition" value="true" />
</module>

似乎Checkstyle将此视为简单的换行符,因此我们应该有一致的8个空格缩进。 IntelliJ将其视为两个嵌套函数,每个函数都需要有一个额外的缩进。知道我需要在IntelliJ中更改哪些设置以使其一致吗?或者如何更改我的checkstyle.xml以适应?

0 个答案:

没有答案
相关问题