Skip to content

Fix linter conflict#924

Merged
tturocy merged 3 commits into
masterfrom
ruff-mismatch
Jun 5, 2026
Merged

Fix linter conflict#924
tturocy merged 3 commits into
masterfrom
ruff-mismatch

Conversation

@edwardchalstrey1
Copy link
Copy Markdown
Member

When saving files in an IDE (e.g. VSCode/Antigravity) with the Ruff plugin installed and format-on-save enabled, the formatter automatically reformats Python slices that contain complex expressions (e.g., changing rst[src_idx:src_idx + 40] to rst[src_idx : src_idx + 40]). This is intentional behavior by modern formatters (like Black and Ruff) to improve readability and complies with PEP 8.

However, the pre-commit hooks for both ruff and flake8 enforce the pycodestyle rule E203 (whitespace before ':'), which strictly disallows this spacing. As a result, files formatted correctly by the IDE were being rejected by the pre-commit linters, blocking commits. This could be an annoying blocker other developers may face.

Description of the changes in this PR

This PR adds E203 to the ignore list for both linters:

  • Updated pyproject.toml to ignore E203 in [tool.ruff.lint].
  • Updated .flake8 to include extend-ignore = E203.
  • Saved one file as an example and was able to commit the change without the pre-commit complaining

How to review this PR

Decide if this is something we need.

@tturocy tturocy merged commit 7ded85a into master Jun 5, 2026
26 checks passed
@tturocy tturocy deleted the ruff-mismatch branch June 5, 2026 13:52
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.

2 participants