Java Intellij IDEA 检查样式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26955766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Intellij IDEA checkstyle
提问by Maxim Gotovchits
I've got a problem trying to import my check-style to IDEA 14. That's what I do:
我在尝试将我的检查样式导入 IDEA 14 时遇到问题。这就是我所做的:
- File -> Settings -> Inspections -> Import
- There I choose my checkstyle.xml and then I don't know why but TempProfile is created.
- Hmm, ok, looks like this TempProfile can check my code using my checkstyle.xml but it doesn't!
- 文件 -> 设置 -> 检查 -> 导入
- 在那里我选择了我的 checkstyle.xml,然后我不知道为什么但是创建了 TempProfile。
- 嗯,好的,看起来这个 TempProfile 可以使用我的 checkstyle.xml 检查我的代码,但它没有!
采纳答案by barfuin
Go to the Checkstyle configuration page via File → Settings, then typing checkstyle
into the search box:
通过 File → Settings 进入 Checkstyle 配置页面,然后checkstyle
在搜索框中输入:
Press the plusicon to add your checkstyle.xml. Activate your checkstyle.xml by clicking the checkbox in the column labeled Active.
按加号图标添加您的 checkstyle.xml。通过单击标记为Active的列中的复选框激活 checkstyle.xml 。
That's it!
If you want real-time scans, you can go to the Inspections dialog and activate the real-time scan:
就是这样!
如果您想要实时扫描,您可以转到“检查”对话框并激活实时扫描: