Skip to content

[pre-commit.ci] pre-commit autoupdate#1053

Merged
bruAristimunha merged 5 commits intodevelopfrom
pre-commit-ci-update-config
Apr 10, 2026
Merged

[pre-commit.ci] pre-commit autoupdate#1053
bruAristimunha merged 5 commits intodevelopfrom
pre-commit-ci-update-config

Conversation

pre-commit-ci bot and others added 5 commits April 6, 2026 18:56
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.
@bruAristimunha bruAristimunha merged commit 7f1d1ec into develop Apr 10, 2026
11 of 12 checks passed
@bruAristimunha bruAristimunha deleted the pre-commit-ci-update-config branch April 10, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant