Skip to content
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
92 changes: 47 additions & 45 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,48 @@ formatters:
linters:
default: all
disable:
- decorder # Don't care about this
- dupl # Basically every table driven test ever triggers this
- dupword # Messes with test cases more often than not
- err113 # Out of date
- exhaustruct # No
- forbidigo # Nothing to forbid
- funlen # Bad metric for complexity
- ginkgolinter # I don't use whatever this is
- gochecknoglobals # Globals are fine sometimes, use common sense
- gocognit # cyclo with another name
- gocyclo # cyclop does this instead
- godox # "todo" and "fixme" comments are allowed
- goheader # No need
- gosmopolitan # No need
- grouper # Imports take care of themselves, rest is common sense
- ireturn # This is just not necessary or practical in a real codebase
- lll # Auto formatters do this and what they can't do I don't care about
- maintidx # This is just the inverse of complexity... which is cyclop
- nestif # cyclop does this
- nlreturn # Similar to wsl, I think best left to judgement
- noinlineerr # Inline errors are fine
- nonamedreturns # Named returns are often helpful, it's naked returns that are the issue
- paralleltest # I've never had Go tests take longer than a few seconds, it's fine
- unparam # gopls is better and more subtle
- varnamelen # Lots of false positives of things that are fine
- wrapcheck # Not every error must be wrapped
- wsl # Very aggressive, some of this I like but tend to do anyway
- wsl_v5 # As above, just newer version
- decorder # Don't care about this
- dupl # Basically every table driven test ever triggers this
- dupword # Messes with test cases more often than not
- err113 # Out of date
- exhaustruct # No
- forbidigo # Nothing to forbid
- funlen # Bad metric for complexity
- ginkgolinter # I don't use whatever this is
- gochecknoglobals # Globals are fine sometimes, use common sense
- gocognit # cyclo with another name
- gocyclo # cyclop does this instead
- godox # "todo" and "fixme" comments are allowed
- goheader # No need
- gomodguard # Deprecated
- gosmopolitan # No need
- grouper # Imports take care of themselves, rest is common sense
- ireturn # This is just not necessary or practical in a real codebase
- lll # Auto formatters do this and what they can't do I don't care about
- maintidx # This is just the inverse of complexity... which is cyclop
- nestif # cyclop does this
- nlreturn # Similar to wsl, I think best left to judgement
- noinlineerr # Inline errors are fine
- nonamedreturns # Named returns are often helpful, it's naked returns that are the issue
- paralleltest # I've never had Go tests take longer than a few seconds, it's fine
- unparam # gopls is better and more subtle
- varnamelen # Lots of false positives of things that are fine
- wrapcheck # Not every error must be wrapped
- wsl # Very aggressive, some of this I like but tend to do anyway
- wsl_v5 # As above, just newer version

exclusions:
presets:
# See https://golangci-lint.run/usage/false-positives/#exclusion-presets
- comments # Revive in particular has lots of false positives
- comments # Revive in particular has lots of false positives
- std-error-handling
- common-false-positives
rules:
- path: _test\.go
linters:
- prealloc # These kinds of optimisations will make no difference to test code
- gosec # Tests don't need security stuff
- prealloc # These kinds of optimisations will make no difference to test code
- gosec # Tests don't need security stuff
- goconst # Annoying

paths:
- tabwriter
Expand Down Expand Up @@ -90,13 +92,13 @@ linters:

gosec:
excludes:
- G104 # Errors not checked, handled by errcheck
- G104 # Errors not checked, handled by errcheck

govet:
enable-all: true

nakedret:
max-func-lines: 0 # Disallow any naked returns
max-func-lines: 0 # Disallow any naked returns

nolintlint:
allow-unused: false
Expand All @@ -117,48 +119,48 @@ linters:
enable-all-rules: true
rules:
- name: add-constant
disabled: true # goconst does this
disabled: true # goconst does this

- name: argument-limit
arguments:
- 5

- name: cognitive-complexity
disabled: true # gocognit does this
disabled: true # gocognit does this

- name: comment-spacings
arguments:
- "nolint:"

- name: cyclomatic
disabled: true # cyclop does this
disabled: true # cyclop does this

- name: enforce-switch-style
disabled: true # exhaustive handles this
disabled: true # exhaustive handles this

- name: exported
arguments:
- checkPrivateReceivers
- checkPublicInterface

- name: function-length
disabled: true # Bad proxy for complexity
disabled: true # Bad proxy for complexity

- name: function-result-limit
arguments:
- 3

- name: import-shadowing
disabled: true # predeclared does this
disabled: true # predeclared does this

- name: line-length-limit
disabled: true # gofmt/golines handles this well enough
disabled: true # gofmt/golines handles this well enough

- name: max-public-structs
disabled: true # This is a dumb rule
disabled: true # This is a dumb rule

- name: redefines-builtin-id
disabled: true # predeclared does this
disabled: true # predeclared does this

- name: unhandled-error
arguments:
Expand All @@ -167,10 +169,10 @@ linters:
- bytes.Buffer.Write(String|Byte)?

- name: flag-parameter
disabled: true # As far as I can work out this just doesn't like bools
disabled: true # As far as I can work out this just doesn't like bools

- name: unused-parameter
disabled: true # The gopls unused analyzer covers this better
disabled: true # The gopls unused analyzer covers this better

- name: unused-receiver
disabled: true # As above
disabled: true # As above
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module go.followtheprocess.codes/hue

go 1.26

require golang.org/x/term v0.42.0
require golang.org/x/term v0.43.0

require golang.org/x/sys v0.43.0 // indirect
require golang.org/x/sys v0.44.0 // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
2 changes: 1 addition & 1 deletion hue.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func autoDetectEnabled() bool {
}

// Finally check if stdout's file descriptor is a terminal (best effort)
//nolint:gosec // No overflow realistically possible here

if term.IsTerminal(int(os.Stdout.Fd())) {
return true
}
Expand Down
Loading