From 2a931d406089e3da9f7813a9eeea44028a97a432 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Thu, 29 Jan 2026 12:40:08 +0000 Subject: [PATCH 1/3] Upgrade to Go 1.25.6 --- go.mod | 4 ++-- go.sum | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 0e2b2aa..c6c80c6 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/git-pkgs/managers -go 1.25.0 +go 1.25.6 -require gopkg.in/yaml.v3 v3.0.1 // indirect +require gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 4bc0337..a62c313 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 09a91f90dc07416225d93c830bbf13caa54c9d38 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Thu, 29 Jan 2026 13:38:52 +0000 Subject: [PATCH 2/3] Add CI workflow and fix gosimple lint warning --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ translator.go | 4 +--- 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fe96f50 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.25'] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: ${{ matrix.go-version }} + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v -race -coverprofile=coverage.out ./... + + - name: Upload coverage + if: matrix.go-version == '1.25' + uses: codecov/codecov-action@v5 + with: + files: coverage.out + fail_ci_if_error: false + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: '1.25' + + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: latest diff --git a/translator.go b/translator.go index b353f69..1e3e72a 100644 --- a/translator.go +++ b/translator.go @@ -180,9 +180,7 @@ func (t *Translator) buildSingleCommand(binary string, cmd definitions.Command, } // Add default flags - for _, flagStr := range cmd.DefaultFlags { - args = append(args, flagStr) - } + args = append(args, cmd.DefaultFlags...) // Add user-specified flags for name, val := range input.Flags { From b739af14f2bfcfed5690fd33f33b3221ebf61363 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Thu, 29 Jan 2026 13:49:43 +0000 Subject: [PATCH 3/3] Fix lint warnings in example code --- docs/examples/dependabot-cron/main.go | 2 +- docs/examples/git-pkgs-integration/apply.go | 5 +++-- docs/examples/git-pkgs-integration/main.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/examples/dependabot-cron/main.go b/docs/examples/dependabot-cron/main.go index 45be51e..201a2b0 100644 --- a/docs/examples/dependabot-cron/main.go +++ b/docs/examples/dependabot-cron/main.go @@ -223,7 +223,7 @@ func updateDependency(ctx context.Context, tr *managers.Translator, managerName, if err := gitCommand(repoPath, "checkout", "-b", branchName); err != nil { return fmt.Errorf("creating branch: %w", err) } - defer gitCommand(repoPath, "checkout", "-") // Return to original branch + defer func() { _ = gitCommand(repoPath, "checkout", "-") }() // Return to original branch // Build and run the update command cmd, err := tr.BuildCommand(managerName, "update", managers.CommandInput{ diff --git a/docs/examples/git-pkgs-integration/apply.go b/docs/examples/git-pkgs-integration/apply.go index 32e1549..2d13390 100644 --- a/docs/examples/git-pkgs-integration/apply.go +++ b/docs/examples/git-pkgs-integration/apply.go @@ -208,9 +208,10 @@ func ecosystemToManagerWithFallback(ecosystem, detected string) string { // getGitPkgsOutdated calls git-pkgs outdated --json and parses the output func getGitPkgsOutdated(repoPath, updateType string) ([]OutdatedPackage, error) { args := []string{"outdated", "--format", "json"} - if updateType == "patch" { + switch updateType { + case "patch": // No filter needed, include all - } else if updateType == "minor" { + case "minor": args = append(args, "--minor") // Skip patch-only } diff --git a/docs/examples/git-pkgs-integration/main.go b/docs/examples/git-pkgs-integration/main.go index 08f23fe..c857bc1 100644 --- a/docs/examples/git-pkgs-integration/main.go +++ b/docs/examples/git-pkgs-integration/main.go @@ -128,7 +128,7 @@ func applyUpdate(ctx context.Context, tr *managers.Translator, manager, repoPath // runCommand executes a command in the specified directory func runCommand(ctx context.Context, args []string, dir string) error { - ctx, cancel := context.WithTimeout(ctx, 5*time.Minute) + _, cancel := context.WithTimeout(ctx, 5*time.Minute) defer cancel() // In a real implementation, use os/exec