From fefcf9385357ebbac6d82bc82c0012472d0035b2 Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Fri, 30 Oct 2020 16:28:17 +0100
Subject: [PATCH] Add filter compile command skript and call it.

---
 .gitlab-ci.yml                     |  1 +
 utilities/filterCompileCommands.py | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 utilities/filterCompileCommands.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6e05cf62f..a6fd1c46b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -283,6 +283,7 @@ clang-tidy:
     - mkdir -p build_clang_tidy
     - cd build_clang_tidy
     - cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=OFF
+    - ./utilities/filterCompileCommands.py compile_commands.json
     - run-clang-tidy -quiet > clang-tidy-results.txt
 
   artifacts:
diff --git a/utilities/filterCompileCommands.py b/utilities/filterCompileCommands.py
new file mode 100644
index 000000000..e470826f6
--- /dev/null
+++ b/utilities/filterCompileCommands.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import json
+import sys
+
+
+if __name__ == "__main__":
+    if len(sys.argv) != 2:
+        print("usage: ./filterCompileCommands.py compile_commands.json")
+        exit(-1)
+
+    filename = sys.argv[1]
+    print("loading compile commands file: {}".format(filename))
+
+    fin = open(filename, "r")
+    cc = json.load(fin)
+    fin.close()
+
+    print("compile commands read: {}".format(len(cc)))
\ No newline at end of file
-- 
GitLab