Skip to content

Commit

Permalink
chore(lint): switch to enable-all linters config (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekomeowww authored Dec 13, 2024
1 parent 229930c commit 40c5213
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 74 deletions.
123 changes: 64 additions & 59 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,74 @@
run:
allow-parallel-runners: true

issues:
exclude:
- "if statements should only be cuddled with assignments" # from wsl
- "if statements should only be cuddled with assignments used in the if statement itself" # from wsl
- "assignments should only be cuddled with other assignments" # from wsl. false positive case: var a bool\nb := true
- "declarations should never be cuddled" # from wsl
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: internal/*
linters:
- dupl
linters:
enable-all: true
disable:
- depguard
- exportloopref
- execinquery
- gomnd
- funlen
- containedctx
- exhaustruct
- testpackage
- varnamelen
- maintidx
- err113
- nlreturn
- wrapcheck
- tagliatelle
- paralleltest
- lll
- contextcheck
- gochecknoglobals
- tagalign
- nilnil
- godot
- godox
- gci
- gocognit
- gocyclo
- cyclop
- ireturn
- gofumpt
- gochecknoinits

linters-settings:
wsl:
allow-assign-and-call: false
strict-append: false
allow-trailing-comment: true
allow-cuddle-declarations: true
allow-separated-leading-comment: true
revive:
rules:
- name: blank-imports
disabled: true
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 9
dupl:
# Tokens count to trigger issue.
# Default: 150
threshold: 600
mnd:
ignored-functions:
- "context.WithTimeout"
- "strconv.ParseComplex"
ignored-files:
- "examples/.*"
gocritic:
disabled-checks:
- ifElseChain
gosec:
excludes:
- G115

linters:
disable-all: true
enable:
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
# - lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- containedctx
- durationcheck
- errname
- exhaustive
- forcetypeassert
- goheader
- goprintffuncname
# - gosec
- musttag
- nestif
- nolintlint
- nosprintfhostport
- predeclared
- reassign
- revive
- tenv
- testableexamples
- whitespace
- wsl
issues:
exclude:
- "if statements should only be cuddled with assignments" # from wsl
- "if statements should only be cuddled with assignments used in the if statement itself" # from wsl
- "assignments should only be cuddled with other assignments" # from wsl. false positive case: var a bool\nb := true
exclude-rules:
- path: _test\.go
linters:
- perfsprint
54 changes: 39 additions & 15 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,67 @@ ignorePaths: []
dictionaryDefinitions: []
dictionaries: []
words:
- containedctx
- contextcheck
- cyclop
- depguard
- dupl
- durationcheck
- errcheck
- errname
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godox
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- ireturn
- lll
- maintidx
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- containedctx
- durationcheck
- errname
- exhaustive
- forcetypeassert
- goheader
- goprintffuncname
- gosec
- musttag
- nakedret
- nestif
- nilnil
- nlreturn
- nolintlint
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- reassign
- revive
- staticcheck
- strconv
- tagalign
- tenv
- testableexamples
- testpackage
- typecheck
- unconvert
- unparam
- unused
- varnamelen
- whitespace
- wrapcheck
- wsl
ignoreWords: []
import: []

0 comments on commit 40c5213

Please sign in to comment.