From: Michael Stapelberg Date: Fri, 6 Oct 2017 05:42:56 +0000 (+0200) Subject: travis: check formatting X-Git-Tag: rgb2rv17~12 X-Git-Url: https://git.sur5r.net/?p=c128-kasse;a=commitdiff_plain;h=a364e4134e6f196cf7f37f2cd9dd86eba758e58e travis: check formatting --- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ab752c9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +sudo: false +language: c +addons: + apt: + packages: + - clang-format-3.8 + +install: true + +# TODO(https://bugs.debian.org/255572): install cc65 once available in Debian, +# verify the source compiles +script: + - ./travis/check-formatting.sh diff --git a/travis/check-formatting.sh b/travis/check-formatting.sh new file mode 100755 index 0000000..ff406be --- /dev/null +++ b/travis/check-formatting.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e +set -x + +clang-format-3.8 -i $(find . -name "*.[ch]" | tr '\n' ' ') && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)