ruff/crates
Dylan c69b19fe1d
[flake8-comprehensions] Handle trailing comma in fixes for unnecessary-generator-list/set (C400,C401) (#15929)
The unsafe fixes for the rules [unnecessary-generator-list
(C400)](https://docs.astral.sh/ruff/rules/unnecessary-generator-list/#unnecessary-generator-list-c400)
and [unnecessary-generator-set
(C401)](https://docs.astral.sh/ruff/rules/unnecessary-generator-set/#unnecessary-generator-set-c401)
used to introduce syntax errors if the argument to `list` or `set` had a
trailing comma, because the fix would retain the comma after
transforming the function call to a comprehension.

This PR accounts for the trailing comma when replacing the end of the
call with a `]` or `}`.

Closes #15852
2025-02-05 07:38:03 -06:00
..
red_knot [red-knot] Support --exit-zero and --error-on-warning (#15746) 2025-02-03 07:35:30 +00:00
red_knot_project [red-knot] Add --ignore, --warn, and --error CLI arguments (#15689) 2025-01-24 16:20:15 +01:00
red_knot_python_semantic [red-knot] Extend instance/class attribute tests (#15959) 2025-02-05 12:45:00 +01:00
red_knot_server [red-knot] Make Diagnostic::file optional (#15640) 2025-01-23 10:43:14 +01:00
red_knot_test [red-knot] MDTest: Fix line numbers in error messages (#15932) 2025-02-04 13:44:05 +00:00
red_knot_vendored Sync vendored typeshed stubs (#15864) 2025-02-01 01:01:58 +00:00
red_knot_wasm Update Rust crate rand to 0.9.0 (#15899) 2025-02-03 12:25:57 +01:00
ruff Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name (#15918) 2025-02-04 17:05:35 -06:00
ruff_annotate_snippets Fix docstring in ruff_annotate_snippets (#15748) 2025-01-26 22:25:29 -05:00
ruff_benchmark Vendor benchmark test files (#15878) 2025-02-02 18:16:07 +00:00
ruff_cache
ruff_db [red-knot] ruff_db: make diagnostic rendering prettier (#15856) 2025-01-31 16:37:02 -05:00
ruff_dev Improve Docs: Pylint subcategories' codes (#15909) 2025-02-03 13:53:36 +01:00
ruff_diagnostics Show errors for attempted fixes only when passed --verbose (#15237) 2025-01-03 08:50:13 -06:00
ruff_formatter Upgrade Rust toolchain to 1.84.0 (#15408) 2025-01-11 09:51:58 +01:00
ruff_graph Add support for configuring knot in pyproject.toml files (#15493) 2025-01-17 09:41:06 +01:00
ruff_index
ruff_linter [flake8-comprehensions] Handle trailing comma in fixes for unnecessary-generator-list/set (C400,C401) (#15929) 2025-02-05 07:38:03 -06:00
ruff_macros Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
ruff_notebook Update Rust crate rand to 0.9.0 (#15899) 2025-02-03 12:25:57 +01:00
ruff_python_ast [red-knot] Use ternary decision diagrams (TDDs) for visibility constraints (#15861) 2025-02-04 14:32:11 -05:00
ruff_python_ast_integration_tests
ruff_python_codegen Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
ruff_python_formatter Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
ruff_python_index
ruff_python_literal Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
ruff_python_parser Simplify the StringFlags trait (#15944) 2025-02-04 18:14:28 +00:00
ruff_python_resolver
ruff_python_semantic Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name (#15918) 2025-02-04 17:05:35 -06:00
ruff_python_stdlib Revert "Add all PEP-585 names to UP006 rule" (#15250) 2025-01-04 12:23:53 +01:00
ruff_python_trivia [red-knot] Hand-written MDTest parser (#15926) 2025-02-04 14:01:53 +01:00
ruff_python_trivia_integration_tests
ruff_server Consider unsafe-fixes settings for code actions (#15666) 2025-01-22 13:44:13 +05:30
ruff_source_file [pyupgrade] Do not report when a UTF-8 comment is followed by a non-UTF-8 one (UP009) (#14728) 2024-12-11 10:30:41 +00:00
ruff_text_size [ruff] itertools.starmap(..., zip(...)) (RUF058) (#15483) 2025-01-16 15:18:12 +01:00
ruff_wasm Update Rust crate rand to 0.9.0 (#15899) 2025-02-03 12:25:57 +01:00
ruff_workspace Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name (#15918) 2025-02-04 17:05:35 -06:00