diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /workhorse/_support | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'workhorse/_support')
-rwxr-xr-x | workhorse/_support/fmt.sh | 25 | ||||
-rwxr-xr-x | workhorse/_support/validate-formatting.sh | 9 |
2 files changed, 25 insertions, 9 deletions
diff --git a/workhorse/_support/fmt.sh b/workhorse/_support/fmt.sh new file mode 100755 index 00000000000..b319ac7e328 --- /dev/null +++ b/workhorse/_support/fmt.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +FLAG=-w +if [ "x$1" = xcheck ]; then + FLAG=-e +fi + +IMPORT_RESULT=$( + goimports $FLAG -local "gitlab.com/gitlab-org/gitlab-workhorse" -l $( + find . -type f -name '*.go' | grep -v -e /_ -e /testdata/ -e '^\./\.' + ) +) + +case "x$1" in + xcheck) + if [ -n "${IMPORT_RESULT}" ]; then + echo >&2 "Formatting or imports need fixing: 'make fmt'" + echo "${IMPORT_RESULT}" + exit 1 + fi + ;; + x) + echo "${IMPORT_RESULT}" + ;; +esac diff --git a/workhorse/_support/validate-formatting.sh b/workhorse/_support/validate-formatting.sh deleted file mode 100755 index 190f646f8df..00000000000 --- a/workhorse/_support/validate-formatting.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/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 |