Introduction

Hey, good to see you on this page. It means that you are considering a contribution of your own work to the Checkstyle project. We welcome anything: bugfixes, new check modules, unit tests, documentation improvements, build process simplification, etc.

This document assumes you are working with the GIT version of checkstyle and that you are familiar with some standard development tools ( GIT, Maven, JUnit).

To start the development - visit our Beginning Development page.

ATTENTION: if you have idea how to improve Checkstyle please create issue on our tracking system. As soon as one of admins of our project approved your idea you are good to start implementation and you will be welcome with final code contribution. Please do not expect that we will accept any code that you send to us. Example of ideal issue description, and how it is commented on fix Pull Request.

ATTENTION: any new Check that you are going to introduce you need to contribute to our sanbox project sevntu.checkstyle. We are receiving only bug fixes for now to our main project, here is a reason.

Quality matters

The developer team of checkstyle is really a lazy bunch of people. We try to avoid work as best as we can, but most of all we try to avoid working on bugs that are reported by end users.

To that end, we use a set of development tools that ensure that the quality of our code is kept at a fairly high level. Like most projects today, we use JUnit to test our code. However we do take this one step further and measure the coverage of our unit tests using Cobertura. This means it is not sufficient to pass all tests, but the tests should ideally execute each line in the code, code coverage should be 100%. To generate the Cobertura report, run the Maven command mvn cobertura:cobertura. Check results on report target/site/cobertura/index.html in project home folder.

Besides using unit testing, we obviously also use checkstyle to check it's own code.

The Maven command mvn clean verify must pass without any errors.

If you add new end user features (Check, Filter, ....), remember to document them in JavaDoc of java classes and xdoc files that used to generate that site. Please recheck site and all bundles generation by mvn clean site

The last step of verification that all works fine please do testing of your functionality on any open-source project (Spring, Hibernate, ....). Here is how to do it from command line

Submitting your contribution

Once you have made sure that your changes pass the Maven command mvn clean verify, the code coverage is of high standard and everything is documented, then you are ready to submit your work.

Please use Pull Request feature of Github.
Please provide wide description of update with detailed explanation of problem and how you propose to resolve it. ATTENTION: Please recheck that in your Pull Request there is ONLY your changes and all of them are rebased from most recent HEAD of our master branch.

ATTENTION: Please provide single-line meaningful message for commit with reference to github issue or Pull Request for more details.
Ideal format for message is "Brief message ..... , issue(or pull request) #NUMBER". Good example

After you do Pull Request please recheck that our where is no problem from our build system: Travis and Coveralls. You will see that your Pull Request on Github is marked by that jobs automatically in few minutes.

We are not only lazy but at times we are also busy with our day jobs. This means that you might not always get an immediate answer. You are not being ignored, and we value your work - we might just be too busy to review your code, especially if it is a bit complex. If you don't get a response within two weeks, feel free to send a reminder email about your tracker item.