mirror of
https://github.com/clang-retro/picolibc.git
synced 2026-11-28 13:19:20 -08:00
This script takes a list of patch files formatted with 'git format-patch' and verifies that the changes result in correctly formatted code. Signed-off-by: Keith Packard <keithp@keithp.com>
33 lines
481 B
Bash
Executable File
33 lines
481 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Usage: checkpatch 0001-diff.patch ...
|
|
#
|
|
ret=0
|
|
declare -a failed
|
|
failed=()
|
|
for patch in "$@"; do
|
|
clang-format-diff -p1 < "$patch"
|
|
case "$?" in
|
|
0)
|
|
;;
|
|
*)
|
|
ret="$?"
|
|
failed+=("$patch")
|
|
;;
|
|
esac
|
|
done
|
|
case "$ret" in
|
|
0)
|
|
echo "All patches appear to be formatted correctly"
|
|
;;
|
|
*)
|
|
echo
|
|
echo "**************"
|
|
for f in "${failed[@]}"; do
|
|
echo "$f: patch formatted incorrrectly"
|
|
done
|
|
echo "**************"
|
|
;;
|
|
esac
|
|
exit "$ret"
|