[Dune-devel] Introducing CI Jobs for Enhanced Code Quality with Linters and Analyzers

Ospina De Los Rios, Santiago santiago.ospina at iwr.uni-heidelberg.de
Wed May 22 14:35:42 CEST 2024


Dear DUNE Developers,


I recently added a CI job template for the core modules aimed at maintaining and improving our code quality using code linters and analyzers such as clang-tidy, Clang/GCC Static Analyzer, and cppcheck. Currently, no specific checks are enforced, but the goal is to incrementally add them to the CI to prevent "easy-to-find" issues from entering our code base.

Here is how it works:

  1.  Configuration: You need to configure a .codechecker/config.json file in one of our core module repositories with settings from CodeChecker. You can refer to the dune-common configuration for an example here<https://gitlab.dune-project.org/core/dune-common/-/merge_requests/1321/diffs>. This will automatically enable the code quality checks.

  2.  Listing Available Checks: To see all the possible code checks available in our core modules CI, run the following command on your machine:

docker run registry.dune-project.org/docker/ci/ubuntu:23.04 /bin/bash -c "ln -s /usr/bin/clang-tidy-18 /duneci/bin/clang-tidy && ln -s /usr/bin/clang-18 /duneci/bin/clang && /duneci/venv/bin/CodeChecker checkers"

  1.  This command lists hundreds of checks that can be added to the configuration file. Our focus should be on identifying the relevant checks that need to be addressed in our current code base and enforced in the future.

  2.  Enabling and Enforcing Checks: Once a check is enabled in a merge request, the CI will report any issues and provide links to the problematic code. The merge request will not succeed until all code quality issues are resolved.

I encourage everyone interested in improving our code base to open merge requests with their preferred linter/analyzer checks!

For more information, please refer to the CodeChecker user guide<https://codechecker.readthedocs.io/en/latest/analyzer/user_guide/>.


Cheers,
Santiago

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20240522/15d68503/attachment.htm>


More information about the Dune-devel mailing list