]> git.sur5r.net Git - c128-kasse/commitdiff
travis: check formatting
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 6 Oct 2017 05:42:56 +0000 (07:42 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 6 Oct 2017 05:47:36 +0000 (07:47 +0200)
.travis.yml [new file with mode: 0644]
travis/check-formatting.sh [new file with mode: 0755]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..ab752c9
--- /dev/null
@@ -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 (executable)
index 0000000..ff406be
--- /dev/null
@@ -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)