Replace flake8 and isort with ruff, and introduce ruff formatter#3395
Merged
dlstadther merged 11 commits intospotify:masterfrom Feb 22, 2026
Merged
Replace flake8 and isort with ruff, and introduce ruff formatter#3395dlstadther merged 11 commits intospotify:masterfrom
dlstadther merged 11 commits intospotify:masterfrom
Conversation
- Add [tool.ruff] config to pyproject.toml (line-length=160, E/F/W/I rules) - Replace [testenv:flake8] and [testenv:isort] with [testenv:ruff] - Remove [flake8] section from tox.ini - isort is now handled by ruff's I ruleset
Fix 209 issues automatically including E713 (not in), I001 (import sorting), and other pycodestyle/pyflakes violations.
unicode does not exist in Python 3; str is the correct type.
Reformat 239 files to match ruff's code style.
dlstadther
reviewed
Feb 21, 2026
dlstadther
reviewed
Feb 21, 2026
Collaborator
dlstadther
left a comment
There was a problem hiding this comment.
I'm a big fan of ruff (vs the combination of flake8/isort/black). The first PR to apply the lint and format rules to a repo that otherwise hasn't had them is hard to review, so thank you very much for separating the auto-applied commits from the manual fixes!
dlstadther
approved these changes
Feb 22, 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.
Description
Replace flake8 and isort with ruff, which handles linting, import sorting, and formatting in a single fast tool.
Previously the project had no formatter configured. This PR also introduces
ruff formatto establish a consistent code style.Changes:
[tool.ruff]configuration topyproject.toml(line-length=160, E/F/W/I rules)[testenv:flake8]and[testenv:isort]with[testenv:ruff]intox.ini[flake8]section fromtox.iniruffinstead offlake8unicodebuiltin usage insalesforce.py(→str)ruff check --fixandruff formatacross the codebaseMotivation and Context
flake8 and isort are maintained separately and require separate configuration. ruff replaces both with a single tool that is significantly faster and already listed in the
lintdependency group. Adding a formatter also removes ambiguity around code style.Have you tested this? If so, how?
uvx ruff check .anduvx ruff format --check .both pass with no errors.