From 55d05565d038c39d4b4e008db02bd728fd7dee7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 24 Oct 2021 23:48:21 +0200 Subject: clang-format: Enable `--Wno-error=unknown` for compat with older versions This prevents errors when encountering options which have been defined in newer versions of clang-format, and are invalid in the YAML for the old version. Bump minimum supported clang-format version to 12 (where `--Wno-error=unknown` was added). Use clang-format 12 on CI (13 is not available yet on the Ubuntu 20.04 images). --- misc/hooks/pre-commit-clang-format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'misc/hooks') diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index 3112f1af5f..de5d9c3f06 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -76,7 +76,7 @@ fi # To get consistent formatting, we recommend contributors to use the same # clang-format version as CI. -RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="11" +RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="12" RECOMMENDED_CLANG_FORMAT_MAJOR_MAX="13" if [ ! -x "$CLANG_FORMAT" ] ; then @@ -146,7 +146,7 @@ do # +++ - timestamp # to both lines working on the same file and having a/ and b/ prefix. # Else it can not be applied with 'git apply'. - "$CLANG_FORMAT" -style=file "$file" | \ + "$CLANG_FORMAT" -style=file "$file" --Wno-error=unknown | \ diff -u "$file" - | \ sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch" done -- cgit v1.2.3