Intellij idea 无法使IntelliJ代码样式与checkstyle配置匹配
我正在为一个Java项目使用checkstyle,我有一个我很满意的Intellij idea 无法使IntelliJ代码样式与checkstyle配置匹配,intellij-idea,checkstyle,Intellij Idea,Checkstyle,我正在为一个Java项目使用checkstyle,我有一个我很满意的checkstyle.xml。然而,我发现有一个地方与我的IntelliJ代码风格规则不一致。这里有一个例子 IntelliJ认为它的格式应该是: thisIsALongFunctionWithMultipleParameters(parameter1, andHereIsASecondFunctionWithMultipleParameters(parameter1, param
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
以适应?这是我无法成功应用forceStrictCondition
的原因之一。我在所有项目中都禁用了它,直到Checkstyle完全支持IDEA格式样式。这是我无法成功应用forceStrictCondition
的原因之一。我在所有项目中都禁用了它,直到Checkstyle完全支持IDEA格式样式