diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db52b1d7ad..f4fb4f44f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + entry: bash -c 'affected_files=(); for f in "$@"; do grep -l "[[:space:]]$" "$f" 2>/dev/null && affected_files+=("$f"); done; if [ ${#affected_files[@]} -gt 0 ]; then trailing-whitespace-fixer "${affected_files[@]}"; exit $?; else exit 0; fi' -- - id: mixed-line-ending - id: check-byte-order-marker - id: check-executables-have-shebangs