Skip to content
Snippets Groups Projects

Add new CMake target to run clang-tidy

Merged Florian Uhlig requested to merge f.uhlig/cbmroot:add_clang_tidy_to_CI into master

Refs #2969

The target will run clang-tidy on all changed source and header files The target is only created if the used clang-tidy supports all required checks. The required checks will be extracted from the clang-tidy configuration file, so the list should be alwyas correct.

Instead of having a hardcoded list of required checks the list is extracted from the clang-tidy config file such that the list is always up to date.

Add CMake script to execute the TidyCheck in our CI

Download and install external packages needed when running clang-tidy. To speed up things execute clang-tidy in parallel on differnt files if more cores are available.

Add shell script used by the CMake target

Check changed header files only if there is a corresponding source file in the compile_commands database. Currently there is no way to test header files without corresponding source file (compilation unit). Create missing but expected output directories. Remove clang-tidy command line option The option was moved to the config file.

The script find_files.sh is now used from two places so pass the required information as parameters. Remove one unneded parameter

Add and disable clang-tidy test in the CI chain

The check is disabled since it isn't yet decided if clang-tidy should be integrated in the CI chain.

Merge request reports

Merge request pipeline #24216 passed

Merge request pipeline passed for 57600f09

Approval is optional

Merged by Pierre-Alain LoizeauPierre-Alain Loizeau 1 year ago (Sep 22, 2023 3:43pm UTC)

Merge details

  • Changes merged into master with 57600f09.
  • Deleted the source branch.

Pipeline #24217 passed

Pipeline passed for 57600f09 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading