mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-17 22:08:28 +00:00
![]() ## Summary This PR attempts to fix the formatting of the following expression: ```python max_message_id = ( Message.objects.filter(recipient=recipient).order_by("id").reverse()[0].id ) ``` Specifically, Black preserves _that_ formatting, while we do: ```python max_message_id = ( Message.objects.filter(recipient=recipient) .order_by("id") .reverse()[0] .id ) ``` The fix here is to add a group around the entire call chain. ## Test Plan Before: - `zulip`: 0.99702 - `django`: 0.99784 - `warehouse`: 0.99585 - `build`: 0.75623 - `transformers`: 0.99470 - `cpython`: 0.75989 - `typeshed`: 0.74853 After: - `zulip`: 0.99703 - `django`: 0.99791 - `warehouse`: 0.99586 - `build`: 0.75623 - `transformers`: 0.99470 - `cpython`: 0.75989 - `typeshed`: 0.74853 |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_shrinking | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm |