Skip to content

move golangci-lint out of tools#253

Merged
peterj merged 1 commit intomainfrom
peterj/movelintoutoftools
Mar 4, 2026
Merged

move golangci-lint out of tools#253
peterj merged 1 commit intomainfrom
peterj/movelintoutoftools

Conversation

@peterj
Copy link
Copy Markdown
Contributor

@peterj peterj commented Mar 4, 2026

Description

moving golangci-lint out of go tools to minimize the dependencies in go.mod

Change Type

/kind cleanup

Changelog

NONE

Additional Notes

Signed-off-by: Peter Jausovec <[email protected]>
Copilot AI review requested due to automatic review settings March 4, 2026 18:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes golangci-lint from the Go module “tool” dependencies to reduce go.mod/go.sum bloat, and updates local/CI lint invocation accordingly.

Changes:

  • Drop golangci-lint (and its transitive deps) from go.mod/go.sum.
  • Update make lint to call golangci-lint directly (instead of go tool golangci-lint).
  • Switch GitHub Actions Go lint job to golangci/golangci-lint-action@v7 pinned to v2.8.0.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
go.mod Removes golangci-lint tool entry and prunes indirect deps that were pulled in via the tool module.
go.sum Removes checksums for golangci-lint’s transitive module graph; retains only app-required sums.
Makefile Updates lint command to use a standalone golangci-lint binary.
.github/workflows/lint.yml Replaces make lint with golangci-lint-action pinned to v2.8.0.
Comments suppressed due to low confidence (1)

Makefile:262

  • make lint now assumes golangci-lint is already installed and on PATH, but the repo pins a specific version in CI. This can lead to inconsistent local lint results (different golangci-lint versions) and a worse onboarding experience. Consider adding an install-golangci-lint (or similar) target/script that installs the pinned version, and point GOLANGCI_LINT at that installed binary by default.
GOLANGCI_LINT ?= golangci-lint
GOLANGCI_LINT_ARGS ?= --fix

.PHONY: lint
lint: ## Run golangci-lint linter
	$(GOLANGCI_LINT) run $(GOLANGCI_LINT_ARGS)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- uses: golangci/golangci-lint-action@v7
with:
version: v2.8.0
args: --fix
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The workflow runs golangci-lint with --fix. In CI this can silently modify files in the runner and still pass when all issues are auto-fixed, which means lint problems may not be caught unless someone happens to run lint locally and commit the changes. Prefer running without --fix in CI, or add a follow-up step to fail the job when git diff is non-empty after linting.

Suggested change
args: --fix

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@timflannagan timflannagan left a comment

Choose a reason for hiding this comment

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

I'd advocate for splitting off to tools/ directory which iirc is what kgateway does today to solve this class of issue where scanners are flagging tool-related direct/indirect dependencies. LGTM for now though.

@peterj peterj added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit 8109548 Mar 4, 2026
10 checks passed
@peterj peterj deleted the peterj/movelintoutoftools branch March 4, 2026 23:05
christian-posta pushed a commit to christian-posta/agentregistry that referenced this pull request Mar 9, 2026
moving golangci-lint out of go tools to minimize the dependencies in
go.mod

```
/kind cleanup
```

```release-note
NONE
```

Signed-off-by: Peter Jausovec <[email protected]>
Bortlesboat added a commit to Bortlesboat/agentregistry that referenced this pull request Mar 27, 2026
Fixes agentregistry-dev#377

After PR agentregistry-dev#253 removed golangci-lint from Go tools, make lint fails
with 'go: no such tool golangci-lint'. Update the GOLANGCI_LINT
variable to use the system-installed binary instead of go tool, and
add a pre-flight check with an install link on failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants