From 28322834578bb5364f45a7b4165dc28ad66744c0 Mon Sep 17 00:00:00 2001 From: Cindy Bang Date: Thu, 23 May 2024 15:18:25 -0400 Subject: [PATCH] makefile: add yamllint target --- .github/workflows/build_test_ci.yml | 5 +++-- Makefile | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test_ci.yml b/.github/workflows/build_test_ci.yml index b772f5328..f09e822d9 100644 --- a/.github/workflows/build_test_ci.yml +++ b/.github/workflows/build_test_ci.yml @@ -49,8 +49,9 @@ jobs: if: ${{ needs.changes.outputs.src == 'true' }} steps: - uses: actions/checkout@v4 - - name: Validate YAML file - run: yamllint templates + + - name: Lint YAML + run: make yamllint go-build-test: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index f44e5f047..70980f105 100644 --- a/Makefile +++ b/Makefile @@ -118,8 +118,8 @@ vet: ## Run go vet against code. gosec: ## Run gosec against code. docker run --rm -w /workdir -v $(PWD):/workdir securego/gosec:2.19.0 -exclude-dir=bin -exclude-generated ./... -.PHONY: lint -lint: ## Run lint against code. +.PHONY: golint +golint: ## Run lint against code. docker run --rm -w /workdir -v $(PWD):/workdir golangci/golangci-lint:v1.57.2 golangci-lint run -c .golangci.yml --fix .PHONY: nilcheck @@ -130,6 +130,13 @@ nilcheck: nilaway ## Run nil check against code. vulncheck: govulncheck ## Run vulnerability check against code. govulncheck ./... +.PHONY: lint +lint: yamllint golint + +.PHONY: yamllint +yamllint: ## Run lint against manifests. + docker run --rm -w /data -v $(PWD):/data cytopia/yamllint:alpine-1 templates + .PHONY: docs docs: @cd docs && mdbook serve -n $(MDBOOK_DEV_HOST) -p $(MDBOOK_DEV_PORT)