Closed zingale closed 4 months ago
hmmm... the version of clang-tidy
in the CI doesn't seem to like this. But it does fix things when I run locally with clang-tidy 17
indeed, this option was only added in clang-tidy 17: https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/ReleaseNotes.html
there must be another way to tell clang-tidy to recognize the headers for old versions. At the moment, clang-tidy is not doing all the checks cause it doesn't treat .H as a header
We can add this to the config file for now.
CheckOptions:
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
- key: bugprone-suspicious-include.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
- key: google-global-names-in-headers.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
- key: google-build-namespaces.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
- key: misc-definitions-in-headers.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
- key: misc-use-anonymous-namespace.HeaderFileExtensions
value: ';H;h;hh;hpp;hxx'
I tested the CheckOptions
above on my local branch. it does seem to work. I now see
/home/runner/work/amrex/amrex/Src/Particle/AMReX_Particle.H:16:1: error: do not use unnamed namespaces in header files [google-build-namespaces,-warnings-as-errors]
namespace
^
okay. I'll update the PR
There will be many errors to fix. Do you want me to help?
I can help. But I'm working through Castro and Microphysics first. Maybe we hold this for a little bit until the other tidy PRs are all done.
fyi @lucafedeli88
After #3867, we can go back to the first commit of this PR.
Summary
the output of
clang-tidy --dump-config
shows that .H is not recognized as a headerAdditional background
Checklist
The proposed changes: