From 9e73d0dac0774955348a5164087363c5b33927b8 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 18 Jan 2019 16:56:54 +0100 Subject: Add tools/report-clang-tidy.sh - Fix various clang-tidy warnings - Fix use-after-free crash when deleting profiles --- tools/cppcheck.sh | 4 ---- tools/report-clang-tidy.sh | 16 ++++++++++++++++ tools/report-cppcheck.sh | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) delete mode 100755 tools/cppcheck.sh create mode 100755 tools/report-clang-tidy.sh create mode 100755 tools/report-cppcheck.sh (limited to 'tools') diff --git a/tools/cppcheck.sh b/tools/cppcheck.sh deleted file mode 100755 index 2b130ce..0000000 --- a/tools/cppcheck.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cppcheck --enable=all --verbose src/ lib/ plugins/ 2> report.txt - 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 + diff --git a/tools/report-cppcheck.sh b/tools/report-cppcheck.sh new file mode 100755 index 0000000..2e42226 --- /dev/null +++ b/tools/report-cppcheck.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cppcheck --enable=all --project=tidy/compile_commands.json 2> report.txt + -- cgit v1.2.1