NO-ISSUE: Use uv run dev.py lint from the pre-commit hook#679
Conversation
The pre-commit hook was calling `bin/golangci-lint` directly, which meant that the tool had to be installed separately before linting could work. This changes the hook to call `uv run dev.py lint` instead, so that the project's development tooling manages the linter lifecycle end to end. To support this the `lint` command now calls `setup.install_golangci_lint` before running the linter, making it self-contained. The `is_installed` helper in `setup.py` is also updated to look in the project's `bin/` directory first and to use the resolved path when checking the installed version, so it correctly detects tools already downloaded by previous runs. Because `lint` now installs its own dependencies, the separate `uv run dev.py setup` step in the CI workflow is no longer needed and has been removed. Assisted-by: Cursor Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
WalkthroughThe PR refactors the linting workflow to prefer project-local golangci-lint binaries, embed tool installation into the lint command, and unify CI and pre-commit hooks to use a single dev.py lint entry point. Binary path resolution, lint integration, and workflow unification are coordinated to ensure consistent tooling. ChangesLinting workflow unification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@jhernand: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@jhernand: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
/retest-required |
Summary
The pre-commit hook was calling
bin/golangci-lintdirectly, which required the tool to beinstalled separately before linting could work. This changes the hook to call
uv run dev.py lintinstead, so that the project's development tooling manages the linter lifecycle end to end.
lintcommand now callssetup.install_golangci_lintbefore running, making itself-contained.
is_installedhelper insetup.pyis updated to check the project'sbin/directory firstand to use the resolved path when verifying the installed version.
uv run dev.py setupstep in the CI workflow is removed sincelintnow handlesits own setup.
Test plan
uv run dev.py lintlocally withoutgolangci-lintpre-installed and verify it installsthe tool and runs the linter successfully.
uv run dev.py lintlocally withgolangci-lintalready inbin/and verify it skipsinstallation and runs the linter.
.gofile and verify it invokesuv run dev.py lint.uv run dev.py setupstep.Summary by CodeRabbit