From 4e6f50edf8a7e9764129394cd832c6afd38ef25a Mon Sep 17 00:00:00 2001 From: Naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:40:54 -0500 Subject: [PATCH] chore: enhance development workflow with unified linting and tool (#472) Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --- .golangci.yml | 24 ++++++++++++++++++++++++ Makefile | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..5e329d86 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,24 @@ +--- +run: + concurrency: 6 + timeout: 5m +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 + new-from-rev: "" + exclude-rules: + - path: 'test/.*' + linters: + - gosec +linters: + enable: + - gofmt + - goimports + - gosec + - govet diff --git a/Makefile b/Makefile index 3f2b0978..87e35fca 100644 --- a/Makefile +++ b/Makefile @@ -57,3 +57,6 @@ clean-test-artifacts: ## removes bundles and zarf packages that have been create push-test-artifacts: ## Push artifacts that UDS CLI tests rely on to GHCR cd hack && ./push-test-artifacts.sh + +lint: ## Run golangci-lint on the project + golangci-lint run ./src/...