From a364e4134e6f196cf7f37f2cd9dd86eba758e58e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 6 Oct 2017 07:42:56 +0200 Subject: [PATCH] travis: check formatting --- .travis.yml | 13 +++++++++++++ travis/check-formatting.sh | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 .travis.yml create mode 100755 travis/check-formatting.sh 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) -- 2.39.2