summaryrefslogtreecommitdiffstats
path: root/ci-legacy/style-check.sh
blob: 683bbcde6d76a9371aded329457b4b8a1b50b322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
set -eu

echo Evaluating changes:
git diff -U0 "$TRAVIS_COMMIT_RANGE"
echo

diffs=$(git diff -U0 --no-color "$TRAVIS_COMMIT_RANGE" | "$CLANG_FORMAT_DIFF" -p1 -iregex '.*\.[ch]$')
if [ "$diffs" != "" ]; then
  echo ==== Style changes required ====
  echo "$diffs"
  exit 1
fi