File: check_format

package info (click to toggle)
mp3fs 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 888 kB
  • sloc: cpp: 1,884; ansic: 564; sh: 298; makefile: 82
file content (19 lines) | stat: -rwxr-xr-x 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash -e
# check_format verifies that files are formatted correctly using clang-format.

. "${BASH_SOURCE%/*}/common.sh"

check_format_single () {
    file=$1
    clang-format "$file" | diff -u "$file" -
}

fix_format_msg () {
    files="$1"
    echo "To fix these files, run"
    echo "  clang-format -i $files"
}

if in_main ; then
    driver check_format_single fix_format_msg
fi