aboutsummaryrefslogtreecommitdiff
path: root/script/check_files_formatting.sh
diff options
context:
space:
mode:
Diffstat (limited to 'script/check_files_formatting.sh')
-rwxr-xr-xscript/check_files_formatting.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/script/check_files_formatting.sh b/script/check_files_formatting.sh
new file mode 100755
index 00000000..11afd2c3
--- /dev/null
+++ b/script/check_files_formatting.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+set -e # halt script on error
+
+# Validate all files adhere to .editorconfig
+# Exclude files which should not be checked against .editorconfig
+# (eg. images, LICENSE, system-generated files, and library files)
+mapfile -t editorconfigargs < <(
+ find . \
+ -type 'f' \
+ ! -name '*.png' \
+ ! -name '*.ico' \
+ ! -name 'LICENSE' \
+ ! -name 'Gemfile.lock' \
+ ! -path './assets/*/libs/*' \
+ ! -path './.bundle/*' \
+ ! -path './.git/*' \
+ ! -path './_site/*' \
+ ! -path './vendor/*' \
+)
+npx @htmlacademy/editorconfig-cli "${editorconfigargs[@]}"