on main help sign in
chore: fix lint on interp.ExecHandler (#3200)
6b68930Kieran Klukas
.golangci.yml+4
@@ -37,6 +37,10 @@ linters:
37 - text: '(slog|log)\.\w+'
37 - text: '(slog|log)\.\w+'
38 linters:
38 linters:
39 - noctx
39 - noctx
40+ - path: internal/shell/run.go
41+ text: "SA1019.*interp.ExecHandler"
42+ linters:
43+ - staticcheck
40issues:
44issues:
41 max-issues-per-linter: 0
45 max-issues-per-linter: 0
42 max-same-issues: 0
46 max-same-issues: 0
internal/shell/run.go+3−1
@@ -210,7 +210,9 @@ func execHandlerOption(blockFuncs []BlockFunc) interp.RunnerOption {
210 for _, mw := range slices.Backward(standardHandlers(blockFuncs)) {
210 for _, mw := range slices.Backward(standardHandlers(blockFuncs)) {
211 handler = mw(handler)
211 handler = mw(handler)
212 }
212 }
213− return interp.ExecHandler(handler) //nolint:staticcheck // ExecHandlers always appends DefaultExecHandler which lacks process isolation.
213+ // ExecHandlers always appends DefaultExecHandler which lacks process
214+ // group isolation, so we use the deprecated ExecHandler instead.
215+ return interp.ExecHandler(handler)
214}
216}
215
217
216// nonInteractiveEnvVars are forced on every shell execution to prevent
218// nonInteractiveEnvVars are forced on every shell execution to prevent