servatrice/.ci/travis-lint.sh
tooomm a8b34d51a5 travis: separate lint build (#3778)
* Create travis-lint.sh

* separate lint

* Update travis-lint.sh

* Update travis-lint.sh

* use default image

* call lint externally

* add xenial again for tests

* Update .travis.yml

* fix path

* move test to docker build

* remove --format argument test / passed

* add test label

* use bash command

* source > execute
2019-07-13 15:39:51 -04:00

37 lines
1.1 KiB
Bash

#!/bin/bash
# Check formatting using clang-format
echo "Checking your code using clang-format..."
diff="$(./clangify.sh --diff --cf-version)"
err=$?
case $err in
1)
cat <<EOM
***********************************************************
*** ***
*** Your code does not comply with our styleguide. ***
*** ***
*** Please correct it or run the "clangify.sh" script. ***
*** Then commit and push those changes to this branch. ***
*** Check our CONTRIBUTING.md file for more details. ***
*** ***
*** Thank you ♥ ***
*** ***
***********************************************************
Used clang-format version:
${diff%%
*}
The following changes should be made:
${diff#*
}
Exiting...
EOM
exit 2
;;
0)
echo "Thank you for complying with our code standards."
;;
*)
echo "Something went wrong in our formatting checks: clangify returned $err" >&2
;;
esac