[pre-commit.ci] pre-commit autoupdate#1053
Merged
bruAristimunha merged 5 commits intodevelopfrom Apr 10, 2026
Merged
Conversation
updates: - [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.3.1](psf/black-pre-commit-mirror@25.12.0...26.3.1) - [github.com/PyCQA/isort: 7.0.0 → 8.0.1](PyCQA/isort@7.0.0...8.0.1) - [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.15.9](astral-sh/ruff-pre-commit@v0.14.10...v0.15.9) - [github.com/codespell-project/codespell: v2.4.1 → v2.4.2](codespell-project/codespell@v2.4.1...v2.4.2) - [github.com/adrienverge/yamllint.git: v1.37.1 → v1.38.0](https://github.com/adrienverge/yamllint.git/compare/v1.37.1...v1.38.0)
… ruff
Replace five Python quality hooks with a single ruff + ruff-format pair.
Config changes:
- Remove black, blacken-docs, isort, and flake8 (with 6 plugin deps) hooks
- Add ruff-format alongside the existing ruff lint hook
- Centralize configuration in [tool.ruff] in pyproject.toml; delete setup.cfg
- Rule set: select = [E, F, W, B, C4, I], ignore = [E203, E501, B905]
- Preserve legacy isort profile=black collapsing via
format.skip-magic-trailing-comma=true paired with
isort.split-on-trailing-comma=false (verified identical to isort 5.13.2
black profile across moabb/, scripts/, examples/)
- docstring-code-format=true replaces the .py side of blacken-docs
- Update CONTRIBUTING.md to reference ruff instead of flake8
Code cleanup (side effect of the broader rule set, which the old flake8
config had been silently skipping due to a broken exclude regex):
- Apply 294 ruff auto-fixes (with --unsafe-fixes): C408 dict() -> {},
C416/C419/C420 redundant comprehensions, B006/B007/B028 bugbear fixes,
F401 unused imports, I001 import ordering
- Manually fix 10 remaining issues: 5x B904 (raise ... from err), 2x B007
(rename unused loop vars), 1x E402 (move import to top),
1x B018 and 1x B017 (add targeted noqa with justification)
- Reformat 134 files with skip-magic-trailing-comma=true
…tter The prior ruff --unsafe-fixes run renamed the unused-looking loop variable `subject` to `_subject` in CrossSessionSplitter.get_n_splits, but the very next line references `@subject` inside a pandas `metadata.query(...)` string. Query strings are opaque to static analysis, so ruff couldn't see the reference and the rename broke `test_cross_session_get_n_splits[True/False]` with `UndefinedVariableError: local variable 'subject' is not defined`. Revert the rename and add a targeted `# noqa: B007` with a comment pointing to the query-string reference so future ruff runs leave it alone.
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.
updates: