Projects · Software · Publications

Differential Checkstyle

Someone deactivated Sonarqube. We seem to have a deeper inner confusion with our common understanding of clean code. This is my last attempt at getting something going, after this I am on my wit’s end.

First, this PR reactivates the Checkstyle using updated versions of the GitDiffFilter, which are now externalized as Maven dependencies. The code of the diff filter are here: https://github.com/wadoon/checkstyle-key-extensions. Ownership transferred on acceptance, also published on Maven Central.

The address of the diff is

checkstyle("org.key-project.devel:checkstyle-key-extensions:1.17-SNAPSHOT")

which can then be used across projects. The checkstyle-key-extensions are updated to the latest version of checkstyle, which has two filters now: one for files before parsing, one for issues after linting. checkstyle-key-extensions uses both.

Checkstyle is invoked via Gradle via checkstyleMain and checkstyleTest. Dependencies are managed by Gradle.

The bottleneck is the limited reported possibilities on Github. This PR tries to use everything.

  1. A Markdown Job summary is added image

  2. Sarif files are joined and uploaded: image

  3. HTML checkstyle artifacts can be downloaded image

  4. Moreover, it simplifies the Jacoco integration.

  5. At the end of the Github tests runs, a Gradle task reads JUnit test xml reports and prints out Github annotations. Failing tests should appear on the Github workflow summary.

    image

It does not add a comment to the PR as this is not reliable due to reduced permissions on workflow executions for foreign repositories.

Testing

Testing of this PR is hard. You need

  1. failing test cases
  2. checkstyle violations

It might be a good choice to merge this branch squashily on some of your working branches for testing.