From a0383055e4481575a68e077460b413bcff84dc63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 17:13:35 +0000 Subject: [PATCH 1/2] Update module golang.org/x/term to v0.43.0 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 20582f1..f00f92c 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 11efb67..a29baa3 100644 --- a/go.sum +++ b/go.sum @@ -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= From 425026ba72c691994c2c9c435c4ed584194764ba Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Fri, 8 May 2026 18:30:08 +0100 Subject: [PATCH 2/2] Fix golangci-lint config --- .golangci.yml | 92 ++++++++++++++++++++++++++------------------------- hue.go | 2 +- 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 53eeed3..133a0f9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 @@ -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 @@ -117,24 +119,24 @@ 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: @@ -142,23 +144,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: @@ -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 diff --git a/hue.go b/hue.go index 2a73530..a1d59a6 100644 --- a/hue.go +++ b/hue.go @@ -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 }