Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/_support/validate-formatting.sh')
-rwxr-xr-xworkhorse/_support/validate-formatting.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/workhorse/_support/validate-formatting.sh b/workhorse/_support/validate-formatting.sh
new file mode 100755
index 00000000000..190f646f8df
--- /dev/null
+++ b/workhorse/_support/validate-formatting.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+IMPORT_RESULT=$(goimports -e -local "gitlab.com/gitlab-org/gitlab-workhorse" -l "$@")
+
+if [ -n "${IMPORT_RESULT}" ]; then
+ echo >&2 "Formatting or imports need fixing: 'make fmt'"
+ echo "${IMPORT_RESULT}"
+ exit 1
+fi