Skip to content

Commit

Permalink
Update golangci-lint config to suit current code state.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Jul 1, 2021
1 parent 5cb04d7 commit b82a48c
Showing 1 changed file with 51 additions and 44 deletions.
95 changes: 51 additions & 44 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,76 @@
service:
prepare:
- make install_deps

run:
tests: true
build-tags:
- integration
- fuzz
# fail if go.mod needs changing
modules-download-mode: readonly

linters-settings:
govet:
check-shadowing: true

linters:
enable-all: true
presets:
- bugs
- error
- format
- import
- module
- performance
- test
- unused
- metalinter
enable:
- exportloopref
# A general rule is if the lint author can't be bothered supplying automated
# fixes for obvious lint warnings, I'm not bothered using their tool.
disable:
- whitespace # broken by goyuacc
- dupl # can't exclude test code
- forbidigo # can't exclude non prod tools
- gocognit # worst check ever
- errcheck # handled by gosec
- cyclop # boo cyclomatic complexity
- dupl # exclude test code
- errcheck # handled by gosec, lots of false posi
- exhaustive # this false-positives for switches with a default
- exhaustivestruct # too noisy, labelling fields is not my jam
- forbidigo # exclude non prod tools
- forcetypeassert # too many at the moment
- funlen # My tests will be as long as they need to be thanks
- gochecknoglobals # Flags are fine, as are test tables.
- gochecknoinits # How dare you tell me not to use inits.
- gocognit # boo cyclomatic complexity
- gocyclo # boo cyclomatic complexity
- godox # TODOs are fine
- gosec # run independently
- golint # deprecated
- gomnd # magic numbers in test tables are fine actually
- gosec # run independently
- ifshort # buggy, false positives
- interfacer # deprecated
- exhaustivestruct # too noisy
- testpackage # need to test internal methods
- lll # go says long lines are ok, and this is trivially automatable
- maligned # deprecated
- nakedret # weird thing to report on
- nestif # cognitive complexity
- nlreturn # Not a fan of this one, looks messy
- nolintlint # broken on gocritic
- paralleltest # i had a good reason for this
- maligned
- megacheck
- lll
- gocyclo
- unparam
# Not sure what this is telling me yet.
- scopelint
# How dare you tell me not to use inits.
- gochecknoinits
# Flags are fine, as are test tables.
- gochecknoglobals
# wsl doesn't explain any of its recommendations
- wsl
# magic numbers in test tables are fine actually
- gomnd
# My tests will be as long as they need to be thanks
- funlen
# Not a fan of this one, looks messy
- nlreturn
- testpackage # need to test internal methods
- unparam # too noisy
- whitespace # broken by goyacc
- wrapcheck # not sure this is necessary
- wsl # wsl doesn't explain any of its recommendations

issues:
max-per-linter: 0
max-same: 0
# Show everything.
max-issues-per-linter: 0
max-same-issues: 0
exclude-use-default: true
exclude:
# # Captured by errcheck.
# - '^(G104|G204):'
# # Very commonly not checked.
# - 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
# #- 'exported method (.*\.MarshalJSON|.*\.UnmarshalJSON|.*\.EntityURN|.*\.GoString|.*\.Pos) should have comment or be unexported'
# If you liked it you shoulda put a gofix on it.
# `gofix` should fix this if it really cared
- 'composite literal uses unkeyed fields'
# I like shadowing err
# I like common patterns of shadowing: ctx and err
- 'declaration of "ctx" shadows declaration'
- 'declaration of "err" shadows declaration'
# #- 'bad syntax for struct tag key'
# #- 'bad syntax for struct tag pair'
# goyacc generated error in three locations
- 'this value of `mtailDollar.* is never used'
# Incorrectly reports undeclared in same package
- "undeclared name:"

# Disagree with capitalisation of identifier names
- "ST1003:"

0 comments on commit b82a48c

Please sign in to comment.