KEMBAR78
lint: Replace pycodestyle and pyflakes with ruff by andersk · Pull Request #23431 · zulip/zulip · GitHub
Skip to content

Conversation

@andersk
Copy link
Member

@andersk andersk commented Nov 3, 2022

ruff is an extremely fast Python linter written in Rust. It has near-parity with the pycodestyle and pyflakes rules not covered by Black, plus many helpful Flake8 plugins that we should have been using. It supports caching and autofixing. It’s very actively developed with multiple releases per day at this point. It has some limitations with parsing certain Python 3.9–only syntax features due to its LR(1) parser, which might be concerning if it weren’t so actively developed, but I’m confident that will be addressed in time.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
@andersk andersk added the integration review Added by maintainers when a PR may be ready for integration. label Nov 3, 2022
@timabbott timabbott merged commit d494181 into zulip:main Nov 3, 2022
@timabbott
Copy link
Member

Looks great, merged, thanks @andersk!

@timabbott
Copy link
Member

Also this is just ridiculously fast. I think isort is now our main unreasonably slow python linter.

@andersk andersk deleted the ruff branch November 3, 2022 19:27
@andersk
Copy link
Member Author

andersk commented Nov 3, 2022

@charliermarsh FYI, we’re now using ruff in Zulip! Thanks for this really great tool.

@charliermarsh
Copy link
Contributor

@andersk - Wow, amazing! Thank you for all your contributions too! Please feel free to hold a low bar for filing issues, requesting features, etc.

@charliermarsh
Copy link
Contributor

@timabbott - I'm going to start on import sorting soon (astral-sh/ruff#465). It won't be as flexible as isort, but I'll likely default to profile = "black", so I'm hoping that it will be drop-in compatible for zulip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration review Added by maintainers when a PR may be ready for integration. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants