Content

Introduction

Hey, good to see you on this page. It means that you are considering reporting an issue to the Checkstyle project. We welcome anything: bug reports, feature requests to existing functionality, new Check ideas, etc.

Our issue tracker system is at Github - https://github.com/checkstyle/checkstyle/issues.

How to report a bug?

First and foremost, do not think that your issue is obvious and do not need details.
Even tiny issue need all details (Check name, config with options, source file, Checkstyle version) and context to be shared with us.

The best way to report an Issue is to reproduce it by our Command Line Interface (CLI). It is the most minimalistic way to launch Checkstyle.
PLEASE use our latest released version.

Our project is NOT responsible for problems at any extension or plugins.
Checkstyle is library that is used by number of IDEs and static analysis services.
We fix problems that are only reproducible on latest release.

We need minimized but compilable Java file and minimized config with one Check that cause problem.
We do not need real source code. Any obfuscation of your super secret code is OK.
Link to your source code would be awesome. Code has to be compilable, in other case behaviour could be strange.
Always specify what is expected.

Example of report that we expect (you can skip -Duser.language=en -Duser.country=US if your default locale is English):

Check documentation: https://checkstyle.org/config_whitespace.html#WhitespaceAround

/var/tmp $ javac Test.java

/var/tmp $ cat Test.java
public class Test{ // Doesn't warn - incorrect
private static final int SOMETHING = 1;
}

/var/tmp $ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
        "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
  <module name="TreeWalker">
    <module name="WhitespaceAround">
      <property name="allowEmptyTypes" value="true"/>
    </module>
  </module>
</module>

/var/tmp $ RUN_LOCALE="-Duser.language=en -Duser.country=US"
/var/tmp $ java $RUN_LOCALE -jar checkstyle-6.XX-all.jar -c config.xml Test.java
Starting audit...
Audit done.

Expected: violation on first line.
/var/tmp/Test.java:1:28: error: '{' is not preceded with whitespace.
        

For Windows users, please use "type" command instead of "cat". Example of report that we expect:

Check documentation: https://checkstyle.org/config_misc.html#Indentation

D:\>type config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
    <module name="TreeWalker">
        <module name="Indentation"/>
    </module>
</module>

D:\>type Test.java
class Test {
    void method() {
        try { return; // violation, but it is not expected
        }
        catch (Exception e) { return; // no violation, but expected
        }
    }
}

D:\>set RUN_LOCALE="-Duser.language=en -Duser.country=US"
D:\>java %RUN_LOCALE% -jar checkstyle-8.XX-all.jar -c config.xml Test.java
Starting audit...
[ERROR] D:\Test.java:3: 'try' child has incorrect indentation level 8,
expected level should be 12. [Indentation]
Audit done.

Expected: A violation on line 5 and nowhere else.
D:\Test.java:5: 'catch' child has incorrect indentation level 8,
expected level should be 12. [Indentation]
        

How to request new feature for existing functionality?

Please always specify exact name of the Check/Module.

Please provide detailed description of problem and chunks of code and config that you currently have.

Imagine that everything is possible and propose name of the new option and its behaviour. Do not think that your issue is so obvious.

How to request new Check/Module?

Please provide detailed description of problem.

You have to provide examples of code and expected violations on them. The more examples the better.

If you have open source project, please send a link to the whole java file.