Skip to content

Commit 52da912

Browse files
authored
Enable more linters (#804)
1 parent 2ae1c73 commit 52da912

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.golangci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,33 @@ linters-settings:
55
ignore-generated-header: true
66
rules:
77
- name: blank-imports
8+
- name: constant-logical-expr
89
- name: context-as-argument
910
- name: context-keys-type
11+
- name: defer
1012
- name: dot-imports
13+
- name: duplicated-imports
1114
- name: empty-block
1215
- name: error-naming
1316
- name: error-return
1417
- name: error-strings
1518
- name: errorf
1619
- name: exported
20+
- name: import-shadowing
1721
- name: increment-decrement
1822
- name: indent-error-flow
1923
- name: package-comments
2024
- name: range
25+
- name: range-val-address
26+
- name: range-val-in-closure
2127
- name: receiver-naming
2228
- name: redefines-builtin-id
29+
- name: string-of-int
2330
- name: superfluous-else
2431
- name: time-naming
32+
- name: unchecked-type-assertion
2533
- name: unexported-return
34+
- name: unnecessary-stmt
2635
- name: unreachable-code
2736
- name: unused-parameter
2837
- name: var-declaration
@@ -34,6 +43,7 @@ linters:
3443
- asasalint
3544
- asciicheck
3645
- bidichk
46+
- containedctx
3747
- contextcheck
3848
- copyloopvar
3949
- dupword
@@ -57,10 +67,13 @@ linters:
5767
- govet
5868
- ineffassign
5969
- intrange
70+
- loggercheck
6071
- makezero
72+
- mirror
6173
- misspell
6274
- musttag
6375
- nilerr
76+
- nilnil
6477
- noctx
6578
- nolintlint
6679
- paralleltest

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := build-goreleaser
2-
# renovate: datasource=docker depName=golangci/golangci-lint
2+
# renovate: datasource=github-tags depName=golangci/golangci-lint
33
GOLANGCI_LINT_VERSION = v1.61.0
44
# renovate: datasource=docker depName=goreleaser/goreleaser
55
GORELEASER_VERSION = v2.3.2
@@ -12,7 +12,7 @@ test:
1212

1313
.PHONY: lint
1414
lint:
15-
docker run --pull always --rm -v $(shell pwd):/nginx-asg-sync -w /nginx-asg-sync -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:$(GOLANGCI_LINT_VERSION) golangci-lint --color always run
15+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix
1616

1717
nginx-asg-sync:
1818
@go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally, try using the parameter TARGET=container or TARGET=download\n"; exit $$code)

0 commit comments

Comments
 (0)