Great to see you on this page! It means you are interested in how Checkstyle Addons is built or you are even considering a contribution.
If you’ve got an idea or - even better - some code for a new high-quality check, we should talk about getting it on board. In fact, you can put it on board yourself by creating a pull request for it (more below). The same is true for all kinds of improvements, including improvements to the website.
Checkstyle Addons is using the GitHub Actions
continuous integration system. Every push to master and every pull request are automatically built by GitHub Actions.
If the GitHub Actions status is passing, then it was successfully built with different
Checkstyle versions, and all unit tests were successful.
Test coverage is measured by Codecov. The badge below
shows the current coverage, which is recomputed upon every successful build. Also, the coverage is calculated for every
pull request, and reported on the pull request’s discussion page.
Checkstyle Addons follows a Fork & Pull collaboration model, which means that all changes go through pull
requests.
Please feel free to suggest anything that’s good. If you are going to expend a lot of work, it may make sense to
open an issue
about it first, so we can discuss your plans.
In order to build Checkstyle Addons yourself, follow these steps:
In order to do a full build of Checkstyle Addons, we actually need all JDKs at the same time. It’s no problem to have them all installed as long as each has its own distinct directory. The build process itself must run on Java 17. It is basically possible to skip installing the other JDKs, in which case Gradle will try to procure them for you.
JAVA_HOME
points to the Java 17 SDK, for example
C:\PROGRA~1\Java\jdk-17.0.5+8
(Windows)..gradle
somewhere,
for example D:\.gradle
(Windows) or ~/.gradle
(Unix). Create an environment variable GRADLE_USER_HOME
which
points to this directory. It may grow quite large over time, because Gradle uses it to cache all downloaded stuff.
Mine is almost 10 GB. All Gradle processes, including your IDE, should see this environment variable.(optional) Create an empty text file in $GRADLE_USER_HOME
called gradle.properties
. Inside, add the following
lines:
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx3062m -XX:MaxPermSize=384m
These lines are optional and may be left out if the build works for you.
git clone https://github.com/checkstyle-addons/checkstyle-addons.git
cd checkstyle-addons
./gradlew build
In case you want to use IntelliJ IDEA as your IDE to develop Checkstyle Addons, you need to make sure that these settings are configured correctly:
Java versions are sometimes not properly imported for some versions of IntelliJ. Consider pressing F4 and double checking the Java versions for all modules:
Module | Java |
---|---|
buildSrc | 17 |
main | 7 |
sonarqube | 11 |
test | 7 |
sqtest/main | 11 |
Running the website locally is important in order to be able to test changes before they go online. The Checkstyle Addons
website is based on Jekyll, GitHub’s lightweight but powerful CMS. The
website theme is Thomas Park’s SpaceLab theme, which is based on
Bootstrap. Markdown is GitHub-flavored markdown
(GFM), processed
by kramdown (the GitHub pages standard). Syntax highlighting by
Rouge (again, the GitHub standard). It is technically possible to use
Jemoji in the bodies of pages and posts.
gem install jekyll
, and may take a minute or two because lots of stuff is downloaded from the internet.gem install rouge
on the command line. Rouge is the highlighter required by
GitHub at this time.gem install wdm
) and Jemojis (gem install jemoji
)git clone https://github.com/checkstyle-addons/checkstyle-addons.git
cd checkstyle-addons
git checkout gh-pages
jekyll serve --watch --incremental
Now you can browse the website at http://localhost:4000
A quick list of development resources:
While Checkstyle Addons tries to be as open as possible for new ideas and new code, it is also focused on quality. Thus, there are a small number of criteria that new code must meet:
gradlew clean build site
runs without errors.People rely on Checkstyle Addons to work as documented, so it is most important to minimize bugs and have good documentation. The idea is to provide a stable and correct tool, so fixing known bugs if and when they arise has the highest priority (more than new features).