]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy-diff.py: clang-tidy only supports filename in filter-line, not paths
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 3 Oct 2023 13:46:24 +0000 (15:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 5 Oct 2023 08:31:34 +0000 (10:31 +0200)
.github/scripts/clang-tidy-diff.py

index 396a201b667eb46f50007c6826326b5a033f7b52..1d93fd226c952ca6ef386590a2cc89c1d0ab4a7a 100755 (executable)
@@ -36,6 +36,8 @@ import tempfile
 import threading
 import traceback
 
+from pathlib import Path
+
 try:
   import yaml
 except ImportError:
@@ -242,7 +244,8 @@ def main():
 
   for name in lines_by_file:
     line_filter_json = json.dumps(
-      [{"name": name, "lines": lines_by_file[name]}],
+      # clang-tidy only supports filenames in -line-filter, not paths
+      [{"name": Path(name).name, "lines": lines_by_file[name]}],
       separators=(',', ':'))
 
     # Run clang-tidy on files containing changes.