Skip to content

Commit

Permalink
Use the same golangci-lint settings as terraform-provider-aws.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Dec 20, 2022
1 parent 3105309 commit d9f50a5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,43 @@ issues:
linters:
disable-all: true
enable:
- deadcode
- asciicheck
- errcheck
- errorlint
- goconst
- exportloopref
- gocritic
- gofmt
- gomnd
- gosimple
- govet
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- nolintlint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- unparam
- varcheck
- unused
- vet
- vetshadow
- whitespace

linters-settings:
errcheck:
# TODO: `ignore` is deprecated, but `exclude-functions` does not appear to work
ignore: fmt:.*,github.com/hashicorp/terraform-plugin-framework/tfsdk:SetAttribute,fprintf
# exclude-functions:
# - (*github.com/hashicorp/terraform-plugin-framework/tfsdk.State).SetAttribute
gocritic:
enabled-tags:
- diagnostic
disabled-tags:
- style
- performance
- experimental
- opinionated
gomnd:
settings:
mnd:
Expand All @@ -47,7 +57,9 @@ linters-settings:
- validate.StringLenAtMost
- validate.StringLenBetween
nolintlint:
allow-unused: true # Because of the disabled rules with Go 1.18
allow-unused: false
stylecheck:
checks: ["all", "-ST1003"]
unparam:
check-exported: true

Expand Down
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ testacc:
lint: golangci-lint importlint

golangci-lint:
@echo "==> Checking source code with golangci-lint..."
@golangci-lint run ./internal/...

importlint:
@echo "==> Checking source code with importlint..."
@impi --local . --scheme stdThirdPartyLocal --ignore-generated=true ./...

tools:
Expand Down

0 comments on commit d9f50a5

Please sign in to comment.