ci: run pre-commit on pull requests - #18
Merged
Merged
Conversation
Add a pre-commit CI workflow, apply mechanical hook autofixes (ruff F401/F541, whitespace/EOF), remove an unused test variable, and allow multi-document YAML in check-yaml. Go hooks are scoped out (already covered by golangci-lint).
dmadisetti
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
This repo ships a
.pre-commit-config.yamlwhose hooks were not consistently enforced. This PR makes the pre-commit hooks run reliably in CI and green.Changes
1.
ci: skip: [go-fmt, go-vet]in.pre-commit-config.yamlThis is the key fix. Go formatting/vetting is already enforced by the golangci-lint workflow (
lint.yml), and thednephin/pre-commit-golanggo-vethook is broken for this repo's layout — it fails withno Go files in <root>because the packages live in subdirectories under a single rootgo.mod. Skipping both Go hooks on pre-commit.ci makes that status green; Go quality stays covered by golangci-lint.2. A native
pre-commitGitHub Actions workflowRuns
uvx pre-commit run --all-files --show-diff-on-failureviaastral-sh/setup-uvon PRs and pushes tomain(pre-commit.ci only covers PRs). Read-only, SHA-pinned, caches~/.cache/pre-commit. It usesSKIP: go-fmt,go-vetfor the same reason as above. (If you'd rather rely solely on pre-commit.ci, this workflow can be dropped — theci: skipchange above is the essential part.)3. check-yaml multi-document support
Added
args: [--allow-multiple-documents]— the repo's k8s manifests (config/manager/manager.yaml,deploy/install.yaml,examples/git-sync-sidecar/notebook.yaml) are valid multi-document YAML that the default hook rejected.4. Mechanical hook autofixes (previously unenforced)
F401) inplugin/examples/with-cw.py,plugin/tests/test_status.py; removed extraneous f-string prefixes (F541) inplugin/kubectl_marimo/deploy.py.mock_echoassignment (F841) inplugin/tests/test_deploy.py(kept themocker.patch(...)call)..devcontainer/devcontainer.json, missing trailing newline inhack/boilerplate.go.txt.Verification (local, Go hooks skipped as scoped)
Part of the marimo-team engineering-excellence initiative to make sure every repo's declared quality gates actually run — and pass — in CI.