Frage

My checkstyle-idea.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CheckStyle-IDEA">
    <option name="configuration">
      <map>
        <entry key="active-configuration" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
        <entry key="check-nonjava-files" value="false" />
        <entry key="check-test-classes" value="false" />
        <entry key="location-0" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
        <entry key="suppress-errors" value="false" />
        <entry key="thirdparty-classpath" value="" />
      </map>
    </option>
  </component>
</project>

And i can't seem to find this file in my Ubuntu 14.04. Searched everywhere. The only solution i see is to download it and replace that location.

But is there a way to understand where it is located now? My /etc/environment doesn't contain it also. So where is it? Because CheckStyle works and checks the code in Idea.

War es hilfreich?

Lösung

The Checkstyle-IDEA plugin contains a copy of the Sun Checks (sun_checks.xml). It is contained in the root of the plugin's JAR file. The plugin JAR is usually located at:

  • Linux: ~/.<PRODUCT><VERSION>/config/plugins/CheckStyle-IDEA/lib/checkstyle-idea-4.5.2.jar
  • Windows: C:\Users\<YourUserName>\.<PRODUCT><VERSION>\config\plugins\CheckStyle-IDEA\lib\checkstyle-idea-4.5.2.jar

Version numbers may differ in your case. The part .<PRODUCT><VERSION> should appear as something like .IdeaIC13 (for IntelliJ IDEA version 13).

Note that you should not need to find this file. You should never change it or touch it in any way. If you need to change the rules configuration, create your own rule set and use that. You may of course create your own rule set based on a copy of sun_checks.xml.

Andere Tipps

For mac I located it by typing:

sudo find / -iname Checkstyle-IDEA

Which lead me to

~/Library/Application Support/IntelliJIdea15/CheckStyle-IDEA/lib

I was then able to open the jar with an archive program and make a copy of the sun_checks.xml for my own customization.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top