File: clang-formatter.sh

package info (click to toggle)
uhd 4.8.0.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 183,172 kB
  • sloc: cpp: 279,415; python: 109,850; ansic: 103,348; vhdl: 57,230; tcl: 20,007; xml: 8,581; makefile: 2,863; sh: 2,797; pascal: 230; javascript: 120; csh: 94; asm: 20; perl: 11
file content (48 lines) | stat: -rwxr-xr-x 1,169 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

cformat=${CLANG_FORMAT:-}
if [ -z "$cformat" ]; then
    cformat=$(which clang-format)
fi

_cmd=$1
if [ -z "$_cmd" ]; then
    _cmd="apply"
fi

cformat_args=""
case $_cmd in
    apply)
        cformat_args="-i"
        ;;
    check)
        cformat_args="-Werror --dry-run"
        ;;
    check_apply)
        cformat_args="-Werror -i"
        ;;
    *)
        echo "Usage: $0 [check|apply|check_apply]"
esac

find . \
    -path './host/lib/deps' -prune -o \
    -path './host/cmake' -prune -o \
    -path './fpga' -prune -o \
    -path './firmware' -prune -o \
    -path './mpm/lib/mykonos' -prune -o \
    -path './mpm/lib/rfdc' -prune -o \
    -path './mpm/include/mpm/rfdc' -prune -o \
    -path './mpm/tools' -prune -o \
    -path './tools' -prune -o \
    -name "getopt.*" -prune -o \
    -name "cdecode.*" -prune -o \
    -name "*_generated.h" -prune -o \
    -name "*template_lvbitx.*" -prune -o \
    -name "*.cpp" -print -o \
    -name "*.hpp" -print -o \
    -name "*.cpp.in" -print -o \
    -name "*.hpp.in" -print -o \
    -name "*.ipp" -print -o \
    -name "*.c" -print -o \
    -name "*.h" -print | xargs -n 10 -P 2 $cformat $cformat_args