8000 build(deps): bump github.com/sonatard/noctx from 0.3.4 to 0.3.5 by dependabot[bot] · Pull Request #5916 · golangci/golangci-lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build(deps): bump github.com/sonatard/noctx from 0.3.4 to 0.3.5 #5916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ require (
github.com/shirou/gopsutil/v4 v4.25.5
github.com/sirupsen/logrus v1.9.3
github.com/sivchari/containedctx v1.0.3
github.com/sonatard/noctx v0.3.4
github.com/sonatard/noctx v0.3.5
github.com/sourcegraph/go-diff v0.7.0
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions scripts/website/dump_info/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -33,7 +34,7 @@ func main() {
log.Fatalf("Save default exclusions: %v", err)
}

err = saveCLIHelp(filepath.Join("assets", "cli-help.json"))
err = saveCLIHelp(context.Background(), filepath.Join("assets", "cli-help.json"))
if err != nil {
log.Fatalf("Save CLI help: %v", err)
}
Expand Down Expand Up @@ -139,25 +140,25 @@ func saveDefaultExclusions() error {
return saveToJSONFile(filepath.Join("assets", "exclusion-presets.json"), data)
}

func saveCLIHelp(dst string) error {
err := exec.Command("make", "build").Run()
func saveCLIHelp(ctx context.Context, dst string) 8000 error {
err := exec.CommandContext(ctx, "make", "build").Run()
if err != nil {
return fmt.Errorf("can't run make build: %w", err)
}

lintersOut, err := exec.Command("./golangci-lint", "help", "linters").Output()
lintersOut, err := exec.CommandContext(ctx, "./golangci-lint", "help", "linters").Output()
if err != nil {
return fmt.Errorf("can't run linters cmd: %w", err)
}

lintersOutParts := bytes.Split(lintersOut, []byte("\n\n"))

rumCmdHelp, err := getCmdHelp("run")
rumCmdHelp, err := getCmdHelp(ctx, "run")
if err != nil {
return err
}

fmtCmdHelp, err := getCmdHelp("fmt")
fmtCmdHelp, err := getCmdHelp(ctx, "fmt")
if err != nil {
return err
}
Expand All @@ -171,8 +172,8 @@ func saveCLIHelp(dst string) error {
return saveToJSONFile(dst, data)
}

func getCmdHelp(name string) (string, error) {
helpCmd := exec.Command("./golangci-lint", name, "-h")
func getCmdHelp(ctx context.Context, name string) (string, error) {
helpCmd := exec.CommandContext(ctx, "./golangci-lint", name, "-h")
helpCmd.Env = append(helpCmd.Env, os.Environ()...)

help, err := helpCmd.Output()
Expand Down
19 changes: 13 additions & 6 deletions test/bench/bench_test.go
8000
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bench

import (
"bytes"
"context"
"errors"
"fmt"
"go/build"
Expand Down Expand Up @@ -63,7 +64,8 @@ func Benchmark_linters(b *testing.B) {

for _, repo := range repos {
b.Run(repo.name, func(b *testing.B) {
_ = exec.Command(binName, "cache", "clean").Run()
// TODO(ldez): clean inside go1.25 PR
_ = exec.CommandContext(context.Background(), binName, "cache", "clean").Run()

err = os.Chdir(repo.dir)
require.NoErrorf(b, err, "can't chdir to %s", repo.dir)
Expand Down Expand Up @@ -94,7 +96,8 @@ func Benchmark_golangciLint(b *testing.B) {

installGolangCILint(b)

_ = exec.Command(binName, "cache", "clean").Run()
// TODO(ldez): clean inside go1.25 PR
_ = exec.CommandContext(context.Background(), binName, "cache", "clean").Run()

cases := getAllRepositories(b)

Expand Down Expand Up @@ -177,7 +180,8 @@ func cloneGithubProject(tb testing.TB, benchRoot, owner, name string) string {
if _, err := os.Stat(dir); os.IsNotExist(err) {
repo := fmt.Sprintf("https://github.com/%s/%s.git", owner, name)

err = exec.Command("git", "clone", "--depth", "1", "--single-branch", repo, dir).Run()
// TODO(ldez): clean inside go1.25 PR
err = exec.CommandContext(context.Background(), "git", "clone", "--depth", "1", "--single-branch", repo, dir).Run()
if err != nil {
tb.Fatalf("can't git clone %s/%s: %s", owner, name, err)
}
Expand Down Expand Up @@ -210,7 +214,8 @@ func launch(tb testing.TB, run func(testing.TB, string, []string), args []string
func run(tb testing.TB, name string, args []string) {
tb.Helper()

cmd := exec.Command(name, args...)
// TODO(ldez): clean inside go1.25 PR
cmd := exec.CommandContext(context.Background(), name, args...)
if os.Getenv("PRINT_CMD") == "1" {
log.Print(strings.Join(cmd.Args, " "))
}
Expand All @@ -228,7 +233,8 @@ func run(tb testing.TB, name string, args []string) {
func countGoLines(tb testing.TB) int {
tb.Helper()

cmd := exec.Command("bash", "-c", `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1`)
// TODO(ldez): clean inside go1.25 PR
cmd := exec.CommandContext(context.Background(), "bash", "-c", `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1`)

out, err := cmd.CombinedOutput()
if err != nil {
Expand Down Expand Up @@ -341,7 +347,8 @@ func installGolangCILint(tb testing.TB) {

parentPath := findMakefile(tb)

cmd := exec.Command("make", "-C", parentPath, "build")
// TODO(ldez): clean inside go1.25 PR
cmd := exec.CommandContext(context.Background(), "make", "-C", parentPath, "build")

output, err := cmd.CombinedOutput()
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion test/testshared/install.go
9E88
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testshared

import (
"context"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -48,7 +49,8 @@ func InstallGolangciLint(tb testing.TB) string {
defer builtLock.Unlock()

if !built {
cmd := exec.Command("make", "-C", parentPath, "build")
// TODO(ldez): clean inside go1.25 PR
cmd := exec.CommandContext(context.Background(), "make", "-C", parentPath, "build")

output, err := cmd.CombinedOutput()
require.NoError(tb, err, "can't install golangci-lint %s", string(output))
Expand Down
4 changes: 3 additions & 1 deletion test/testshared/integration/fix.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package integration

import (
"context"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -30,7 +31,8 @@ func setupTestFix(t *testing.T) []string {

sourcesDir := filepath.Join(testdataDir, "fix")

err := exec.Command("cp", "-R", sourcesDir, tmpDir).Run()
// TODO(ldez): clean inside go1.25 PR
err := exec.CommandContext(context.Background(), "cp", "-R", sourcesDir, tmpDir).Run()
require.NoError(t, err)

return findSources(t, tmpDir, "in", "*.go")
Expand Down
4 changes: 3 additions & 1 deletion test/testshared/runner.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testshared

import (
"context"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -263,8 +264,9 @@ func (r *Runner) Command() *exec.Cmd {

runArgs := append([]string{r.command}, r.args...)

// TODO(ldez): clean inside go1.25 PR
//nolint:gosec // we don't use user input here
cmd := exec.Command(r.binPath, runArgs...)
cmd := exec.CommandContext(context.Background(), r.binPath, runArgs...)
cmd.Env = append(os.Environ(), r.env...)

return cmd
Expand Down
Loading
0