-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Closed
Labels
better-engineeringRelatively self-contained tasks for better engineering contributorsRelatively self-contained tasks for better engineering contributorsenhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: buildBuild system issuesBuild system issuestriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🚀 The feature, motivation and pitch
- The PyTorch codebase is huge. Formatting and linting the repo takes a lot of time. Additionally, adding new linters is a bit of challenge. https://github.com/charliermarsh/ruff is a Rust linter/fixer that implements rules for the most common of flake8 linters (pyupgrade, flake8, isort, popular flake8-plugins etc). Many of our existing linters can be combined here. The only downside is that it does reduce the number of flake8-plugins we can use (since they are all reimplemented in the framework), but it does many of the autofixes. Even if we don't replace flake8 etc with this plugin, we can use it supplement it, by using it only for other modules like pyupgrade (where you can select individual pyupgrade rules etc.). I've been using to implement various PRs and it's pretty reasonable so far. See Consider upgrade to Python 3.8+ syntax with
pyupgrade
#94040
Alternatives
Keep the existing linters
Additional context
It's also really, really fast!
SigureMo, justinchuby and Skylion007SigureMo and Skylion007SigureMo
Metadata
Metadata
Assignees
Labels
better-engineeringRelatively self-contained tasks for better engineering contributorsRelatively self-contained tasks for better engineering contributorsenhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: buildBuild system issuesBuild system issuestriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module