[英]Issue in checkstyle configuration in IntelliJ Idea
我的目標是實現Google的Java Style Checkstyle,如https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html中所述 。
在IntelliJ中,我啟用了Checkstyle插件並嘗試指向checkstyle xml(從https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml下載)。
我有以下異常:
Property 'fileExtensions' in module Checker does not exist
雖然此屬性在xml中定義為
<property name="fileExtensions" value="java, properties, xml"/>
例外細節:
org.infernus.idea.checkstyle.exception.CheckStylePluginException:
The CheckStyle rules file could not be loaded.
Property 'fileExtensions' in module Checker does not exist, please check the documentation
at org.infernus.idea.checkstyle.checker.CheckerFactory.blacklistAndShowMessage(CheckerFactory.java:248)
at org.infernus.idea.checkstyle.checker.CheckerFactory.createChecker(CheckerFactory.java:202)
您遇到了版本問題。 在撰寫本文時,Checkstyle的IntelliJ插件仍然在6.1.1版本上,因為IntelliJ仍在MacOS上的Java 6下運行。 Checkstyle 6.1.1是仍然使用Java 6的最后一個Checkstyle版本。
fileExtensions
屬性是在Checkstyle 6.3中引入的。 今天的google_checks.xml也使用了Checkstyle 6.5中引入的EmptyCatchBlock檢查。
因此,為了今天在IntelliJ中使用Google檢查,您必須使用基於Checkstyle 6.1.1的google_checks.xml版本,可以在此處找到。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.