summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-07-27 12:25:44 (GMT)
committerThomas Haller <thaller@redhat.com>2023-07-27 12:30:05 (GMT)
commit590e8a61f899e76ae064ad68cff4766a77c5414a (patch)
tree0b95c02a63ad88ce34593b89a27a84262db507ba
parent06dc5ae0e71d22d01a161448418d123f860a54a3 (diff)
downloadlibnl-590e8a61f899e76ae064ad68cff4766a77c5414a.zip
libnl-590e8a61f899e76ae064ad68cff4766a77c5414a.tar.gz
libnl-590e8a61f899e76ae064ad68cff4766a77c5414a.tar.bz2
tools: improve failure message with "tools/clang-format.sh -n"
-rwxr-xr-xtools/clang-format.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/clang-format.sh b/tools/clang-format.sh
index 992a810..f430114 100755
--- a/tools/clang-format.sh
+++ b/tools/clang-format.sh
@@ -548,7 +548,9 @@ if [ $TEST_ONLY = 1 ]; then
trap 'rm -f "$FF"' EXIT
clang-format "$f" 2>/dev/null > "$FF"
git --no-pager diff "$f" "$FF" || :
- die "Error: file \"$f\" has style issues."$'\n'"Fix it by running \`\"$0\" -i \"$f\"\` using $(clang-format --version)"
+ FEDORA_VERSION="$(sed -n 's/^ image: fedora:\([0-9]\+\)$/\1/p' .github/workflows/ci.yml)"
+ die "Error: file \"$f\" has style issues."$'\n'"Fix it by running \`\"$0\"\` using $(clang-format --version)
+Alternatively, run \`./tools/clang-format-container.sh\` to use a podman container named \"libnl-code-format-f$FEDORA_VERSION\"."
fi
done
die "an unknown error happened."