diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-25 00:38:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 00:38:44 +0200 |
commit | 92a2380d967d5a99ad3942529b50c933aed07f54 (patch) | |
tree | b61c1059ad0ee3bf78d6d6284fa64b7e3a7f5b64 | |
parent | ccf07f47adf10f1d8bcfd5fc005024d107c2ff7e (diff) | |
parent | 55d05565d038c39d4b4e008db02bd728fd7dee7a (diff) |
Merge pull request #54206 from akien-mga/clang-format-no-error-unknown
-rw-r--r-- | .github/workflows/static_checks.yml | 4 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-clang-format | 4 | ||||
-rwxr-xr-x | misc/scripts/clang_format.sh | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index fd2e748076..f60046e0dd 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -22,9 +22,9 @@ jobs: - name: Install dependencies run: | - sudo apt-get install -qq dos2unix recode clang-format-11 + sudo apt-get install -qq dos2unix recode clang-format-12 sudo update-alternatives --remove-all clang-format - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100 + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 100 sudo pip3 install black==20.8b1 pygments - name: File formatting checks (file_format.sh) 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 diff --git a/misc/scripts/clang_format.sh b/misc/scripts/clang_format.sh index bcd63aa73b..b0020da597 100755 --- a/misc/scripts/clang_format.sh +++ b/misc/scripts/clang_format.sh @@ -23,7 +23,7 @@ while IFS= read -rd '' f; do for extension in ${CLANG_FORMAT_FILE_EXTS[@]}; do if [[ "$f" == *"$extension" ]]; then # Run clang-format. - clang-format -i "$f" + clang-format --Wno-error=unknown -i "$f" # Fix copyright headers, but not all files get them. if [[ "$f" == *"inc" ]]; then continue 2 |