Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clang-tidy. #2406

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft

Conversation

thorstenhater
Copy link
Contributor

@thorstenhater thorstenhater commented Sep 12, 2024

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.

@boeschf
Copy link
Contributor

boeschf commented Sep 16, 2024

cscs-ci run default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants