Skip to content

Commit

Permalink
Enable more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Sep 25, 2024
1 parent 11fc4f3 commit 537a83e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,33 @@ linters-settings:
ignore-generated-header: true
rules:
- name: blank-imports
- name: constant-logical-expr
- name: context-as-argument
- name: context-keys-type
- name: defer
- name: dot-imports
- name: duplicated-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
- name: import-shadowing
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: range-val-address
- name: range-val-in-closure
- name: receiver-naming
- name: redefines-builtin-id
- name: string-of-int
- name: superfluous-else
- name: time-naming
- name: unchecked-type-assertion
- name: unexported-return
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
Expand All @@ -34,6 +43,7 @@ linters:
- asasalint
- asciicheck
- bidichk
- containedctx
- contextcheck
- copyloopvar
- dupword
Expand All @@ -57,10 +67,13 @@ linters:
- govet
- ineffassign
- intrange
- loggercheck
- makezero
- mirror
- misspell
- musttag
- nilerr
- nilnil
- noctx
- nolintlint
- paralleltest
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL := build-goreleaser
# renovate: datasource=docker depName=golangci/golangci-lint
# renovate: datasource=github-tags depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION = v1.61.0
# renovate: datasource=docker depName=goreleaser/goreleaser
GORELEASER_VERSION = v2.3.2
Expand All @@ -12,7 +12,7 @@ test:

.PHONY: lint
lint:
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
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix

nginx-asg-sync:
@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)
Expand Down

0 comments on commit 537a83e

Please sign in to comment.