diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-07-25 17:46:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 17:46:12 (GMT) |
commit | b78729638bf69dca9e0dd86eddd530d5fc1aef40 (patch) | |
tree | ad54eff533b79d2662dc685e2226e67333e5b698 /bin/format_source | |
parent | 8a364dd086df040af0bef02515f90841e0a8dc88 (diff) | |
download | hdf5-b78729638bf69dca9e0dd86eddd530d5fc1aef40.zip hdf5-b78729638bf69dca9e0dd86eddd530d5fc1aef40.tar.gz hdf5-b78729638bf69dca9e0dd86eddd530d5fc1aef40.tar.bz2 |
sync bin dir with develop (#3270)
Diffstat (limited to 'bin/format_source')
-rwxr-xr-x | bin/format_source | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/format_source b/bin/format_source index fb0264c..dea771c 100755 --- a/bin/format_source +++ b/bin/format_source @@ -6,6 +6,20 @@ # Note that any files or directories that are excluded here should also be # added to the 'exclude' list in .github/workflows/clang-format-check.yml +COMMAND="clang-format" + +if [ $# -eq 1 ]; then + COMMAND="$COMMAND-$1" +fi + +echo "" +echo "bin/format_source <version>" +echo "" +echo "Format the HDF5 C source using clang-format. The <version>" +echo "parameter is optional and can be used to force a specific" +echo "installed version of clang-format to be used." +echo "" + find . \( -type d -path ./config -prune -and -not -path ./config \) \ -or \( \( \! \( \ -name H5LTanalyze.c \ @@ -19,6 +33,6 @@ find . \( -type d -path ./config -prune -and -not -path ./config \) \ -or -name H5overflow.h \ \) \) \ -and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp -or -iname *.java \) \) \ - | xargs -P0 -n1 clang-format -style=file -i -fallback-style=none + | xargs -P0 -n1 ${COMMAND} -style=file -i -fallback-style=none exit 0 |