arbor icon indicating copy to clipboard operation
arbor copied to clipboard

Use clang-tidy.

Open thorstenhater opened this issue 1 year ago • 1 comments

Allow (opt-in) to run clang-tidy on Arbor.

Limitations currently are:

  • excluded
    • lmorpho
    • modcc
    • tests (clang-tidy doesn't always see EXPECT_EQ(a, b) as a use of a and b)
  • exclude all dependency by --- rather crudely --- dropping a .clang-tidy into the src-dirs
  • only the default set of checks is in use clang-analyzer-*
    • more / advanced checks are added as a comment in .clang-tidy but require fixing more issues.
    • modernize: useful, but at least in one instance dangerously wrong std::vector<size_t>(size, val) => {size, val}
    • misc: has some interesting things, especially wrt included headers, but it's a lot of noise.
    • bugprone: use after free, while important, has some issues.

Sensible suggestions were implemented and as only two weird ones remained, I massaged the code to appease the Linter despite being quite sure of a false positive.

Things left disabled can be toggled on after a while.

thorstenhater avatar Sep 12 '24 17:09 thorstenhater

cscs-ci run default

boeschf avatar Sep 16 '24 08:09 boeschf