Check the format of modified lines only

Use the -U0 option to generate a patch that contains only the modified
lines without any context
master
Vasil Velichkov 5 years ago committed by Andre Puschmann
parent 20ff016e40
commit dc9df9f08f

@ -44,7 +44,7 @@ target=$1
echo "Running code format check between ${target} and ${commit} .." echo "Running code format check between ${target} and ${commit} .."
# run clang-format # run clang-format
diff="$(git diff ${target} | clang-format-diff -p1 | python3 -c 'data = open(0).read(); print(data); exit(1 if data else 0)')" diff="$(git diff -U0 ${target} | clang-format-diff -p1 | python3 -c 'data = open(0).read(); print(data); exit(1 if data else 0)')"
# safe return code # safe return code
ret=$? ret=$?

Loading…
Cancel
Save