Add standardized linting workflow and config#53
Merged
C-Achard merged 2 commits intocy/pre-release-fixes-2.0from Feb 20, 2026
Merged
Add standardized linting workflow and config#53C-Achard merged 2 commits intocy/pre-release-fixes-2.0from
C-Achard merged 2 commits intocy/pre-release-fixes-2.0from
Conversation
Add default_stages and explicitly assign stages to hooks, separating local mutating hooks from CI-only checks. Configure check-* hooks (check-added-large-files, check-yaml, check-toml, check-merge-conflict) to run in pre-commit and manual where appropriate; mark end-of-file-fixer, trailing-whitespace and pyproject-fmt as local-only. Add validate-pyproject to pre-commit/manual. Rework ruff hooks into distinct local autofix entries (ruff-check with --fix/--unsafe-fixes and ruff-format write) and CI check-only entries (named ruff-check (ci) and ruff-format (ci) with non-writing args). Remove the prior name-tests-test entry and add clarifying comments and names for maintainability.
Switch workflow to run pre-commit only for pull requests and only on files changed in the PR. Adds a detect_changes job to fetch the base ref and output changed file list, then a conditional precommit job that runs only when there are changed files. Updates checkout and setup actions (actions/checkout@v4, setup-python@v5), bumps Python to 3.12, installs pre-commit, and runs pre-commit in a CI check-only mode on the changed files to speed up CI and avoid running on the whole repo.
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.
Standardized formatting
Updates the pre-commit workflow and configuration to ensure only changed files in a pull request are checked.
Introduces a clear separation between local autofix hooks and CI check-only hooks.
Updated hooks versions.
NOTE : Since pre-commit hooks were actively used in #38 no particular "Apply lint" PR is required as of now.
Workflow improvements:
.github/workflows/format.ymlworkflow now detects changed files in a pull request and only runs pre-commit checks on those files, reducing unnecessary work and speeding up CI.actions/checkoutandactions/setup-python, and now runs on Python 3.12.Pre-commit configuration enhancements:
.pre-commit-config.yamlfile now clearly separates hooks that can autofix files (run locally) from those that only check (run in CI), using thestagesfield to control when each hook runs.ruff-checkandruff-format, ensuring that CI checks do not modify files but only report issues.