Check the format of modified lines only

Use the -U0 option to generate a patch that contains only the modified
lines without any context
This commit is contained in:
Vasil Velichkov 2019-10-19 02:41:34 +03:00 committed by Andre Puschmann
parent 20ff016e40
commit dc9df9f08f
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ target=$1
echo "Running code format check between ${target} and ${commit} .."
# 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
ret=$?