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
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- name: Vendor modules for later steps.
run: |
go mod vendor
- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
- uses: golangci/golangci-lint-action@v9.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.55
# The version of golangci-lint to use (full version with patch number)
version: v2.8.0
args:
-v
98 changes: 56 additions & 42 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,61 @@
# The Go Language Working Group is currently working on a finalized version
# of this configuration file to share with all Hubbers.

linters:
enable:
- depguard
- errcheck
- exportloopref
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unused
disable:
- gochecknoglobals # we allow global variables in packages
- gochecknoinits # we allow inits in packages
- goconst # we allow repeated values to go un-const'd
- lll # we allow any line length
- unparam # we allow function calls to name unused parameters
- maligned # clear structs are more important than saving a few bytes.
version: "2"

linters-settings:
depguard:
rules:
main:
files:
- "$all"
- "!$test"
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
linters:
enable:
- copyloopvar
- depguard
- errcheck
- gocritic
- gocyclo
- gosec
- govet
- ineffassign
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- unconvert
- unused
disable:
- gochecknoglobals # we allow global variables in packages
- gochecknoinits # we allow inits in packages
- goconst # we allow repeated values to go un-const'd
- lll # we allow any line length
- unparam # we allow function calls to name unused parameters
settings:
depguard:
rules:
main:
files:
- $all
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The depguard configuration uses $all without quotes on line 35, but uses quoted '!$test' on line 36. For consistency and to ensure proper YAML parsing, both should use the same quoting style. Consider using quotes for both: '$all' and '!$test'.

Suggested change
- $all
- '$all'

Copilot uses AI. Check for mistakes.
- '!$test'
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- internal/deprecated$

run:
timeout: 5m
skip-dirs:
- internal/deprecated
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion internal/ptree/ptree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestWalkChildren(t *testing.T) {
require.Equal(t, "ready", string(ready[:]))

var numChildren int
ptree.WalkChildren(cmd.Process.Pid, func(pid int) {
ptree.WalkChildren(cmd.Process.Pid, func(_ int) {
numChildren++
})
assert.Equal(t, depth, numChildren)
Expand Down
2 changes: 1 addition & 1 deletion pipe/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (s *commandStage) filterCmdError(err error) error {
// doesn't do anything on Windows, where the `Signaled()`
// method isn't implemented (it is hardcoded to return
// `false`).
ps, ok := eErr.ProcessState.Sys().(syscall.WaitStatus)
ps, ok := eErr.Sys().(syscall.WaitStatus)
if ok && ps.Signaled() &&
(ps.Signal() == syscall.SIGTERM || ps.Signal() == syscall.SIGKILL) {
return ctxErr
Expand Down
1 change: 0 additions & 1 deletion pipe/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func TestCopyEnvWithOverride(t *testing.T) {
}

for _, ex := range examples {
ex := ex
t.Run(ex.label, func(t *testing.T) {
assert.ElementsMatch(t, ex.expectedResult,
copyEnvWithOverrides(ex.env, ex.overrides))
Expand Down
3 changes: 2 additions & 1 deletion pipe/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Env struct {
// and is not reported to the caller.
//
//revive:disable:error-naming
//nolint:staticcheck // ST1012: FinishEarly is the intentional name for this sentinel error
var FinishEarly = errors.New("finish stage early")

//revive:enable:error-naming
Expand Down Expand Up @@ -67,7 +68,7 @@ type Pipeline struct {
panicHandler StagePanicHandler
}

var emptyEventHandler = func(e *Event) {}
var emptyEventHandler = func(_ *Event) {}

type nopWriteCloser struct {
io.Writer
Expand Down
3 changes: 1 addition & 2 deletions pipe/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func TestFunction(t *testing.T) {
pipe.Print("hello world"),
pipe.Function(
"farewell",
func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error {
func(_ context.Context, _ pipe.Env, _ io.Reader, _ io.Writer) error {
panic("this is a panic")
},
),
Expand Down Expand Up @@ -886,7 +886,6 @@ func TestErrors(t *testing.T) {
expectedErr: err1,
},
} {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading