summary refs log tree commit diff
path: root/.ci
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-09-24 17:08:11 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-09-24 17:08:11 +0300
commit37ff1398b78e5685080e94d532de84691a3ecddc (patch)
tree575ea42940bb94586fb0a5198a2f855266c850ff /.ci
parentManually remove KDE accelerators (diff)
downloadnheko-37ff1398b78e5685080e94d532de84691a3ecddc.tar.xz
Add clang-format to ci
Diffstat (limited to '.ci')
-rwxr-xr-x.ci/format.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/.ci/format.sh b/.ci/format.sh
new file mode 100755
index 00000000..be15598a
--- /dev/null
+++ b/.ci/format.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+# Runs the Clang Formatter
+# Return codes:
+#  - 1 there are files to be formatted
+#  - 0 everything looks fine
+
+set -o errexit
+set -o pipefail
+set -o nounset
+
+FILES=`find include src tests -type f -type f \( -iname "*.cc" -o -iname "*.h" \)`
+
+clang-format -i $FILES && git diff --exit-code