Pre commit hooks#73
Merged
Merged
Conversation
Configures pre-commit with ruff (lint + format), file hygiene checks (trailing whitespace, EOF, yaml/toml/json validation, merge conflicts, large files, AST), gitleaks for secret scanning, and a guard against direct commits to main/master. Adds pre-commit to the dev extras so contributors can install via `uv sync --extra dev && uv run pre-commit install`.
Closed
| args: [--maxkb=500] | ||
| - id: check-ast | ||
| - id: no-commit-to-branch | ||
| args: [--branch, main, --branch, master] |
Contributor
There was a problem hiding this comment.
podriamos poner esto en los CI checks también por si alguien se salta el pre-commit hook?
Contributor
There was a problem hiding this comment.
- name: Run pre-commit on all files
run: pre-commit run --all-files
Catches violations when contributors bypass the local hook with --no-verify. Uses the same .pre-commit-config.yaml as the local install so there's no duplication.
- Bump ruff-pre-commit to v0.15.12 to match the local ruff version, fixing 'Unknown rule selector: UP046' from the v0.9.0 pin. - Exclude bundled frontend dist directories (studio-desktop/frontend-dist and studio/static) from all hooks — they're build outputs, not source. - Exclude tsconfig*.json from check-json: tsconfig uses JSONC (comments, trailing commas). - Switch CI step to plain 'pre-commit run --all-files' instead of the pre-commit/action wrapper for transparency.
javier-alvarez
approved these changes
Apr 27, 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.
Summary
Add pre commit hooks
Changes
Type of Change
Checklist
mvn verifypasses locally with no new warnings