Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit 6f35d9d

Browse files
committed
Add more linters
1 parent 803593f commit 6f35d9d

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
- name: Checkout Repository
3030
uses: actions/checkout@v2
3131
- name: Lint Code
32-
uses: golangci/golangci-lint-action@v2.5.2
32+
uses: golangci/golangci-lint-action@v2
3333
with:
3434
args: --timeout ${{ env.GOLANGCI_TIMEOUT }}

.golangci.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,31 @@ linters-settings:
44

55
linters:
66
enable:
7+
- asciicheck
8+
- deadcode
9+
- errcheck
10+
- errorlint
11+
- gofmt
12+
- gofumpt
713
- goimports
14+
- gosec
815
- gosimple
916
- govet
17+
- ineffassign
18+
- makezero
1019
- misspell
11-
- gofmt
12-
- unparam
13-
- unconvert
20+
- nilerr
21+
- noctx
22+
- predeclared
23+
- staticcheck
1424
- structcheck
15-
- errcheck
25+
- typecheck
26+
- unconvert
27+
- unparam
28+
- unused
29+
- varcheck
30+
- wastedassign
1631
disable-all: true
32+
issues:
33+
max-issues-per-linter: 0
34+
max-same-issues: 0

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ fmt: ## Run go fmt against code.
8585
vet: ## Run go vet against code.
8686
go vet ./...
8787

88+
lint: ## Run golangci-lint against code.
89+
docker run --pull always --rm -v $(shell pwd):/nginx-ingress-operator -w /nginx-ingress-operator -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run
90+
91+
8892
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
8993
test: manifests generate fmt vet ## Run tests.
9094
mkdir -p ${ENVTEST_ASSETS_DIR}

0 commit comments

Comments
 (0)