File: reformat-source.sh

package info (click to toggle)
hackrf 2026.01.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 38,216 kB
  • sloc: ansic: 60,696; python: 6,072; xml: 3,424; perl: 2,730; makefile: 601; asm: 514; vhdl: 319; sh: 179; awk: 20
file content (18 lines) | stat: -rwxr-xr-x 469 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

VERSION=`clang-format --version | grep -o '[^ ]*$' | cut -d '.' -f 1`
if [ "$VERSION" -ge "14" ]; then
    CLANG_FORMAT=clang-format
elif clang-format-14 --version > /dev/null; then
    CLANG_FORMAT=clang-format-14
else
    echo "clang-format version 14 or higher is required."
    exit 1
fi

$CLANG_FORMAT \
    -i \
    --style=file \
    host/libhackrf/src/*.{c,h} \
    host/hackrf-tools/src/*.c \
    firmware/{common,common/rad1o,hackrf_usb}/*.{c,h}