We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
clang-format-all.sh
1 parent f1ad6b6 commit c81d281Copy full SHA for c81d281
etc/clang-format-all.sh
@@ -12,7 +12,8 @@
12
set -o errexit
13
set -o pipefail
14
15
-clang-format --version
+clang_format_binary="${CLANG_FORMAT_BINARY:-clang-format}"
16
+"${clang_format_binary:?}" --version
17
18
source_dirs=(
19
src
@@ -21,11 +22,11 @@ source_dirs=(
21
22
)
23
24
mapfile -t source_files < <(
- find "${source_dirs[@]:?}" -regextype posix-egrep -regex '.*\.(hpp|hh|cpp)'
25
+ find "${source_dirs[@]:?}" | grep -E '.*\.(hpp|hh|cpp)$'
26
27
28
if [[ -n "${DRYRUN:-}" ]]; then
- clang-format --dry-run -Werror "${source_files[@]:?}"
29
+ "$clang_format_binary" --dry-run -Werror "${source_files[@]:?}"
30
else
- clang-format --verbose -i "${source_files[@]:?}"
31
+ "$clang_format_binary" --verbose -i "${source_files[@]:?}"
32
fi
0 commit comments