summaryrefslogtreecommitdiffstats
path: root/buildtools/clangtidy-helper.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /buildtools/clangtidy-helper.sh
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'buildtools/clangtidy-helper.sh')
-rw-r--r--buildtools/clangtidy-helper.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/buildtools/clangtidy-helper.sh b/buildtools/clangtidy-helper.sh
new file mode 100644
index 0000000..f4ef5b9
--- /dev/null
+++ b/buildtools/clangtidy-helper.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+##
+## usage: clangtidy-helper [list of cpp files]
+##
+## Without arguments, run for all source files.
+##
+
+set -e
+
+mkdir -p build
+cd build
+
+cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+
+run-clang-tidy -fix -header-filter='.*' "$@" > /dev/null || true
+
+# revert all fixes in protected directories
+git checkout ../src/3rdparty/ ../src/2geom/
+
+git diff | tee clang_tidy_diff
+
+if [[ -s clang_tidy_diff ]]; then
+ exit 1
+fi