diff --git a/.github/workflows/check-and-build.yml b/.github/workflows/check-and-build.yml index 378d2ba..67604f7 100644 --- a/.github/workflows/check-and-build.yml +++ b/.github/workflows/check-and-build.yml @@ -30,8 +30,11 @@ jobs: -verbose ) set -x -u -o pipefail + shopt -s globstar # Enable **/ for recursive globbing clang-format --version git ls-files '*.c' '*.cpp' '*.h' \ + | grep -vf <(grep -rl "^DisableFormat: *true" **/.clang-format \ + | sed 's:/.clang-format::') \ | xargs clang-format "${clang_format_args[@]}" git diff --exit-code # i.e. fail CI on non-empty diff