A very short blog post to share some minimal code snippets on how to quickly and easily setup Gitlab CI pipelines to run static code analysis tools on

Setting up linters in Gitlab CI for C++ and Groovy / Jenkins code

submited by
Style Pass
2024-04-30 12:00:08

A very short blog post to share some minimal code snippets on how to quickly and easily setup Gitlab CI pipelines to run static code analysis tools on C++ code and Jenkins pipelines (or any Groovy code). Linting C++ code with clang-tidy clang-tidy is a clang-based C++ linter tool that …

A very short blog post to share some minimal code snippets on how to quickly and easily setup Gitlab CI pipelines to run static code analysis tools on C++ code and Jenkins pipelines (or any Groovy code).

clang-tidy is a clang-based C++ linter tool that can identify and auto-fix some programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis.

This default file is a strict starting point: it enables all rules, except the ones specific to LLVM, and treat all warnings as errors. You can then add -${ruleName} to the Checks entry in this file to disable some checks. Check the clang-tidy documentation for more details about rules and suppressing errors & warnings using code comments.

You can also generate an exhaustive .clang-tidy configuration file, with an extra CheckOptions field listing all default values for rules parameters, by running this command:

Leave a Comment
Related Posts