diff --git a/.circleci/config.yml b/.circleci/config.yml index 130247282..94ed85f1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: fi - run: | case $CIRCLE_NODE_INDEX in - 0) sudo -E make -e lint go-tests ci-go-coverage ;; + 0) sudo -E make -e lint-ci go-tests ci-go-coverage ;; 1) sudo -E make -e deploy-test-checks-root deploy-test-config ;; 2) sudo -E make -e deploy-test-multi ;; 3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;; diff --git a/tests.mk b/tests.mk index f93f97ae5..3465ff805 100644 --- a/tests.mk +++ b/tests.mk @@ -42,7 +42,7 @@ else endif endif -ci-dependencies: bats shellcheck shfmt xmlstarlet +ci-dependencies: bats shellcheck xmlstarlet setup-deploy-tests: ifdef ENABLE_DOKKU_TRACE @@ -80,16 +80,19 @@ lint-setup: @find . -not -path '*/\.*' -not -path './debian/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | egrep -B1 "bash" | grep "==>" | awk '{ print $$2 }' > tmp/shellcheck/test-files @cat tests/shellcheck-exclude | sed -n -e '/^# SC/p' | cut -d' ' -f2 | paste -d, -s > tmp/shellcheck/exclude -lint: lint-setup - # verifying via shfmt - # shfmt -l -bn -ci -i 2 -d . - @shfmt -l -bn -ci -i 2 -d . - +lint-ci: lint-setup # these are disabled due to their expansive existence in the codebase. we should clean it up though @cat tests/shellcheck-exclude | sed -n -e '/^# SC/p' @echo linting... @cat tmp/shellcheck/test-files | xargs shellcheck -e $(shell cat tmp/shellcheck/exclude) | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $(shell cat tmp/shellcheck/exclude) +lint-shfmt: shfmt + # verifying via shfmt + # shfmt -l -bn -ci -i 2 -d . + @shfmt -l -bn -ci -i 2 -d . + +lint: lint-shfmt lint-ci + ci-go-coverage: docker run --rm -ti \ -e DOKKU_ROOT=/home/dokku \