-1

I've been slowly working on enabling clang-tidy checks in my project and I'm running into an issue with the readability-identifier-naming check. Sometimes it just doesn't highlight some names as incorrectly formatted but it will only do that in certain files. Example when the namespace case is set as lower_case this snippet is found as violating the rules in some files but not others.

namespace testingUtilites{};

Clang-tidy is given the same arguments for all the files in question. I've also found that it just misses some functions names and I don't know why. Is this a common issues? How do I fix it?

Here's a minimal example of the clang-tidy command we're using

clang-tidy  <list of files> -- -D<macro_flags> -Isrc  -isystem /usr/lib/x86_64-linux-gnu/hdf5/serial/include  -isystem /usr/local/cuda-11.4/include -L/lib64 -pthread -lgtest -lhdf5_cpp -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lhdf5 -L/usr/local/cuda-11.4/lib64 -lcudart -isystem /usr/lib/x86_64-linux-gnu/openmpi/include > tidy_results_cpp_hydro.log 2>&1 &
bcaddy
  • 73
  • 5
  • 1
    could you please give us more information on how you initiate clang-tidy? There is absolutely no way for us to help you unless there is either a minimal reproducible example or more information. Thank you. – Eljas Hyyrynen Jul 11 '23 at 13:15
  • Sorry, I added our clang-tidy invocation. I'm not able to generate a minimal reproducible example so here's the PR in question. Clang-tidy didn't catch `namespace testingUtilities {}` in its current file but did if I put it pretty much anywhere else. https://github.com/cholla-hydro/cholla/pull/309 – bcaddy Jul 11 '23 at 15:01
  • To make a reproducible example, pick any file that contains a violation you expect to be reported but isn't, then delete as much of that file's contents as you can, so long as the violation is present but not reported. Then, edit your answer so it contains that file's reduced content and the exact `clang-tidy` command. – Scott McPeak Jul 11 '23 at 19:32

1 Answers1

0

The answer to this turned out to be that our HeaderFilterRegex was wrong and was excluding a few of our headers too, not just the system and library headers. If you're having trouble try setting the header filter regex to just .*.

bcaddy
  • 73
  • 5