Run clang-tidy in meson
Meson has built in functionality for running clang-tidy. It improves on
run-clang-tidy because it will also run each header file individually,
rather than relying on their #inclusion into a src file, which can find
far more missing #includes, and seems to find more issues in complex
source files (unclear why).
Tested: I've walked through all the repos that have a .clang-tidy, and
I've systematically fixed the issues, so hopefully this change has no
impact. I have yet to see this cause any functional impact.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I62520056192d876938ddab4d7cdafc954fa1806d
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index 664e7ec..07a17ff 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -1033,9 +1033,7 @@
if not os.path.isfile(".openbmc-no-clang"):
check_call_cmd("meson", "compile", "-C", build_dir)
try:
- check_call_cmd(
- "run-clang-tidy", "-fix", "-format", "-p", build_dir
- )
+ check_call_cmd("ninja", "-C", build_dir, "clang-tidy")
except subprocess.CalledProcessError:
check_call_cmd(
"git", "-C", CODE_SCAN_DIR, "--no-pager", "diff"