【发布时间】:2018-06-22 10:13:08
【问题描述】:
我使用的是 IntelliJ IDEA 版本 2017.3,然后我安装插件 CheckStyle-IDEA v 5.16.0 成功,我安装 Apache Maven Checkstyle Plugin 运行myCheckFile.xml。在install 阶段,我收到了许多检查样式错误,例如:
Indentation: '.' has incorrect indentation level 6, expected level should be 8.
Indentation: 'new' has incorrect indentation level 6, expected level should be 8.
导入 CheckStyle settings 后,我希望当我在 IntelliJ IDEA 中按 Ctrl+Alt+L 时,所有检查样式错误都会消失但这不会发生,是我缺少什么吗?
【问题讨论】:
-
checkstyle 未与格式化程序结合使用。您需要明确告诉格式化程序要做什么。
-
你能分享一下你的checkstyle方案吗? IDEA 格式化程序可能不支持所有设置。
-
如果您安装保存操作插件并将其配置为在保存时重新格式化,那么它将自动为您格式化
标签: java maven intellij-idea checkstyle