From cf6181fd304974c66f78d63b83d8339bc2ea6b4e Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Mon, 11 Mar 2024 11:21:28 -0400 Subject: [PATCH] refactor: move shellcheck under linters (#133) Signed-off-by: Artur Troian --- .../workflows/{shellcheck.yaml => lint-shell.yaml} | 11 +++++------ make/lint.mk | 14 +++++++++++++- make/test.mk | 8 -------- 3 files changed, 18 insertions(+), 15 deletions(-) rename .github/workflows/{shellcheck.yaml => lint-shell.yaml} (74%) diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/lint-shell.yaml similarity index 74% rename from .github/workflows/shellcheck.yaml rename to .github/workflows/lint-shell.yaml index 9d603f78..d912b8cc 100644 --- a/.github/workflows/shellcheck.yaml +++ b/.github/workflows/lint-shell.yaml @@ -1,13 +1,12 @@ -name: shellcheck - +--- +name: lint on: push: paths: - "**.sh" - - ".github/workflows/shellcheck.yaml" - + - ".github/workflows/lint-shell.yaml" jobs: - shellcheck-lint: + shell: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,4 +16,4 @@ jobs: - uses: actions/setup-go@v3 with: go-version: "${{ env.GOLANG_VERSION }}" - - run: make shellcheck + - run: make lint-shell diff --git a/make/lint.mk b/make/lint.mk index 09b891c3..23ab2723 100644 --- a/make/lint.mk +++ b/make/lint.mk @@ -1,3 +1,7 @@ +LINT ?= go \ +proto \ +shell + BUF_LINT_PACKAGES ?= provider \ node @@ -16,8 +20,16 @@ lint-proto-%: .PHONY: lint-proto lint-proto: $(BUF) $(patsubst %, lint-proto-%,$(BUF_LINT_PACKAGES)) +.PHONY: lint-shell +lint-shell: + docker run --rm \ + --volume $(PWD):/shellcheck \ + --entrypoint sh \ + koalaman/shellcheck-alpine:stable \ + -x /shellcheck/script/shellcheck.sh + .PHONY: lint -lint: lint-go lint-proto +lint: $(patsubst %, lint-%,$(LINT)) .PHONY: check-breaking proto-check-breaking: $(BUF) diff --git a/make/test.mk b/make/test.mk index 34705db8..08bd4b3a 100644 --- a/make/test.mk +++ b/make/test.mk @@ -2,14 +2,6 @@ TEST_MODULE ?= ./... COVER_PACKAGES = $(shell go list ./... | grep -v mock | paste -sd, -) -.PHONY: shellcheck -shellcheck: - docker run --rm \ - --volume $(PWD):/shellcheck \ - --entrypoint sh \ - koalaman/shellcheck-alpine:stable \ - -x /shellcheck/script/shellcheck.sh - TEST_TIMEOUT ?= 300 TEST_RACE ?= 0 TEST_NOCACHE ?= 0