aboutsummaryrefslogtreecommitdiff
path: root/tools/report-clang-tidy.sh
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2019-01-18 16:56:54 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2019-01-18 16:56:54 +0100
commit9e73d0dac0774955348a5164087363c5b33927b8 (patch)
tree61eb5d729c4e48e1fabe596f387a3e67a1d1d415 /tools/report-clang-tidy.sh
parentRewrite lib/web to lib/webprofile (diff)
downloadsmolbote-9e73d0dac0774955348a5164087363c5b33927b8.tar.xz
Add tools/report-clang-tidy.sh
- Fix various clang-tidy warnings - Fix use-after-free crash when deleting profiles
Diffstat (limited to 'tools/report-clang-tidy.sh')
-rwxr-xr-xtools/report-clang-tidy.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/report-clang-tidy.sh b/tools/report-clang-tidy.sh
new file mode 100755
index 0000000..eddb703
--- /dev/null
+++ b/tools/report-clang-tidy.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+cp build/compile_commands.json tidy/compile_commands.json
+
+# https://bugs.llvm.org/show_bug.cgi?id=37315
+sed -i 's/-pipe//g' tidy/compile_commands.json
+# do not scan system headers (replace -I with -isystem)
+sed -i 's/\-I\/usr\/include/\-isystem\/usr\/include/g' tidy/compile_commands.json
+
+for folder in $(find src lib -type d)
+do
+ if [[ $folder != *'test' ]]; then
+ clang-tidy -p tidy $folder/*.cpp $folder/*.h > reports/clangtidy-$(basename $folder).txt
+ fi
+done
+