intellij-idea - 无法让 IntelliJ 代码样式匹配 checkstyle 配置
问题描述
我正在将 checkstyle 用于我正在处理的 Java 项目,并且我有一个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
的适应?
解决方案
推荐阅读
- java - 如何使用 Hibernate JoinFormula Annotation 进行多态查询?
- c - 头文件中的“#error”语句不起作用
- python - 我想检查类别页面中的产品是否存在于购物车中,然后使用 django 和 jinja 在网页中显示添加的图标
- javascript - React Semantic UI 无法在 Modal 中提交表单
- reactjs - npm 更新失败,并且在运行 create-react-app 后,一些文件(例如 public、App.js index.js 等)没有安装
- scala - 为什么 T 是扩展类型指示符 C.this.type#T 中 this.type 的类型投影
- reactjs - 在 ReactJs 组件中处理状态的最佳实践是什么
- r - 使用另一个时间序列的增长率插值时间序列(替换 NA)
- perl - sed/awk 有条件地从文件的开头和结尾删除行
- javascript - 无法获取 Angular 材质自动完成值