-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Clang tidy include cleaner #13280
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
base: master
Are you sure you want to change the base?
Clang tidy include cleaner #13280
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# We use pointers to aggregates in a couple of places, intentionally. | ||
# void * would look weird. | ||
Checks: '-bugprone-sizeof-expression' | ||
Checks: ' | ||
-bugprone-sizeof-expression | ||
' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,20 @@ | |
''^tests/functional/lang/eval-fail-set\.nix$'' | ||
]; | ||
}; | ||
clang-tidy = { | ||
enable = true; | ||
# TODO: this requires meson to have been configured | ||
# we could optionally wrap this in a script that runs meson first | ||
# but for now let us keep it simple | ||
# | ||
# clang-tidy doesn't work well running it on multiple files | ||
# TODO: change this to use run-clang-tidy.py | ||
entry = "${pkgs.writeShellScript "clang-tidy-wrapper" '' | ||
for file in "$@"; do | ||
"${pkgs.clang-tools}/bin/clang-tidy" --fix -p ./build "$file" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. meson has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea likely will do that but that runs on all targets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth noting that I did go over the codebase a bit with clang-tidy as a part of #11839. Thanks for picking up that activity! Though we'd need to settle on a good clang-tidy config first. A lot of the checks are rather opinionated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying to emit profile information to see which checks are really slow, so we can get something fast and iterate but I was hitting: llvm/llvm-project#141639 (Not sure if you faced this) |
||
done | ||
''}"; | ||
}; | ||
clang-format = { | ||
enable = true; | ||
# https://github.com/cachix/git-hooks.nix/pull/532 | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can actually be a sequence, since .clang-tidy is in YAML format. So the checks can be composed like so: