Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to golangci-lint version 1.43.0 #65

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# See https://github.com/golangci/golangci-lint-action for more details.
uses: golangci/golangci-lint-action@v2.5.2
with:
version: v1.39
version: v1.43
test:
strategy:
matrix:
Expand Down
88 changes: 83 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ issues:
linters:
disable-all: true
enable:
- bidichk
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- errorlint
- exhaustive
- exportloopref
- gochecknoinits
Expand All @@ -42,7 +44,6 @@ linters:
- gofumpt
- goheader
- goimports
- golint
- gomnd
- gomodguard
- goprintffuncname
Expand All @@ -53,11 +54,14 @@ linters:
- lll
- misspell
- nakedret
- nilnil
- noctx
- nolintlint
- revive
- staticcheck
- structcheck
- stylecheck
- tenv
- tparallel
- typecheck
- unconvert
Expand Down Expand Up @@ -90,6 +94,16 @@ linters-settings:
# Example: `a := b.(CustomStruct)`
check-type-assertions: true

errorlint:
# Prevent false-positive matches for code lines that explicitly do not wrap the error to prevent it become part of
# the public API.
# See https://github.com/svengreb/tmpl-go/issues/39 and https://github.com/svengreb/tmpl-go/issues/64 for details.
errorf: false

gci:
# A comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
local-prefixes: github.com/svengreb/tmpl-go

goconst:
min-len: 2
min-occurrences: 3
Expand All @@ -102,6 +116,7 @@ linters-settings:

gofumpt:
extra-rules: true
lang-version: "1.17"

goheader:
values:
Expand All @@ -118,9 +133,6 @@ linters-settings:
# A comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
local-prefixes: github.com/svengreb/tmpl-go

golint:
min-confidence: 0.0

gomnd:
settings:
mnd:
Expand All @@ -133,6 +145,7 @@ linters-settings:

lll:
line-length: 160
tab-width: 2

misspell:
locale: US
Expand All @@ -141,9 +154,74 @@ linters-settings:
- tmpl-go
- tmplgo

# See https://github.com/mgechev/revive#available-rules and
# https://github.com/mgechev/revive#recommended-configuration for more details.
revive:
ignore-generated-header: false
severity: warning
error-code: 1
# Ignore linting errors with less than 0.2 confidence.
confidence: 0.2
rules:
- name: atomic
- name: context-as-argument
- name: deep-exit
- name: defer
- name: duplicated-imports
severity: error
- name: early-return
- name: empty-block
- name: empty-lines
- name: error-naming
- name: error-return
severity: error
- name: error-strings
- name: errorf
- name: exported
arguments:
- checkPrivateReceivers
- disableStutteringCheck
- name: identical-branches
- name: if-return
- name: import-shadowing
severity: error
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
severity: error
- name: string-of-int
severity: error
- name: superfluous-else
- name: time-equal
- name: time-naming
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unhandled-error
- name: unreachable-code
- name: useless-break
- name: var-declaration

tagliatelle:
case:
use-field-name: true
rules:
bson: goCamel
json: goCamel
mapstructure: snake
xml: goCamel
yaml: goCamel

wrapcheck:
ignorePackageGlobs:
- github.com/svengreb/tmpl-go/*

# Options for analysis runs.
run:
deadline: 15m

service:
golangci-lint-version: 1.39.x
golangci-lint-version: 1.43.x