diff --git a/.golangci.yml b/.golangci.yml index ae766cb..9768cab 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,45 +16,46 @@ 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 - - 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 + - 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 settings: cyclop: @@ -86,13 +87,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 @@ -113,21 +114,21 @@ 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: exported arguments: @@ -135,23 +136,23 @@ linters: - 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: @@ -160,13 +161,13 @@ 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 - name: var-naming disabled: true diff --git a/go.mod b/go.mod index 65d1348..db35b18 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.26 require ( go.followtheprocess.codes/hue v1.1.0 - golang.org/x/term v0.42.0 + 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 diff --git a/go.sum b/go.sum index eb3e1e4..a6c0d59 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ go.followtheprocess.codes/hue v1.1.0 h1:bPq21YLdWxQ0ki4lIvXCYtgutaGaDUYaSIENDdrrlNQ= go.followtheprocess.codes/hue v1.1.0/go.mod h1:VnCeVmYESGmX7fZJSFs59u8G+5zseCwGdFiJGHCFg4o= -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= diff --git a/spin.go b/spin.go index 99441d3..cce30ee 100644 --- a/spin.go +++ b/spin.go @@ -119,5 +119,5 @@ func isTerminal(w io.Writer) bool { return false } - return term.IsTerminal(int(file.Fd())) //nolint:gosec // Int overflow not really possible + return term.IsTerminal(int(file.Fd())) }