Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Perhaps ☝️ will lead to a much shorter change to the |
|
Would you mind putting together some instructions for how developers should set up their editor to use ruff instead of black? Right now, if I right click a document and select "Format Document" my understanding is that it formats the document using Black. I also have the cursor extension "Black Formatter" installed and assume after this myself and others would be recommended to uninstall it. That just leaves me wondering what other steps we would need to take to fully adopt ruff in our editor in place of black. |
yes. We're using Black for backend code formatting. |
cd632fd to
6431a39
Compare
|
I propose moving from Black to Ruff for both linting and formatting. Ruff's formatter is Black-compatible (same output, just ~100x faster), and gives you linting + formatting from a single tool. Steps
"[python]": { |
6431a39 to
dec4dc7
Compare
dec4dc7 to
3163fa5
Compare


Summary
Why Ruff over Black?
Ruff is a single tool that replaces Black (formatting), flake8 (linting), isort (import sorting), and pyupgrade (syntax modernization) -- all in one. It's written in Rust and runs 10-100x faster than the tools it replaces. Rather than maintaining separate configs and dependencies for each tool, Ruff handles everything through a single
[tool.ruff]section inpyproject.toml.To test this tool run the following command (note: all linting fixes are in the PR above):
uv run ruff check --fix . && uv run ruff format .