IntelliJ checkstyle插件重新格式化

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

我按照步骤add checkstyle

以下是具体步骤:设置步骤

  1. 转到IntelliJ - >首选项 - >插件 - >浏览存储库。
  2. 搜索并安装“Checkstyle-IDEA”插件,重新启动IntelliJ。
  3. 转到IntelliJ - >首选项 - >其他设置 - > Checkstyle。
  4. 在“配置文件”下,单击“+”并将描述命名为“Customized Checkstyle”。
  5. 单击“使用可通过HTTP访问的checkstyle文件”和“忽略无效证书”。
  6. 对于URL使用:https://drive-xxxxxxxxx.xxxxxx.com/view/xxxxx/checkstyle-rules.xml(公司网站)单击“下一步”,然后单击“完成”。
  7. 单击“Customized Checkstyle”复选框,单击“Apply”和“OK”。

我可以在我的代码中实时运行checkstyle。但是,当我重新格式化代码时,格式化的代码与checkstyle不匹配,请你告诉我我做错了什么?

java intellij-idea checkstyle
1个回答
1
投票

代码格式与checkstyle是分开的。但是您可以将checkstyle转换为IDEA的代码格式:设置 - >文件|设置|编辑|代码样式和Scheme的左侧有cog,单击它,然后导入Scheme - > CheckStyle配置:

screenshot

请注意,您需要下载checkstyle xml配置文件。

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