File: format_source

package info (click to toggle)
libhdf4 4.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,384 kB
  • sloc: ansic: 128,700; sh: 15,015; fortran: 12,444; java: 5,863; xml: 1,205; makefile: 794; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (27 lines) | stat: -rwxr-xr-x 834 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# Recursively format all C & C++ sources and header files, except those in the
# 'config' directory and generated files, such as ncgenyy.c, etc.
#
# 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 HDF4 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 \( -iname *.h -or -iname *.c -or -iname *.java \) \
    | xargs -P0 -n1 ${COMMAND} -style=file -i -fallback-style=none

exit 0