ruff/crates
hikaru-kajita 7e652e8fcb
[flake8_comprehensions] Handled special case for C400 which also matches C416 (#10419)
## Summary

Short-circuit implementation mentioned in #10403.

I implemented this by extending C400:
- Made `UnnecessaryGeneratorList` have information of whether the the
short-circuiting occurred (to put diagnostic)
- Add additional check for whether in `unnecessary_generator_list`
function.

Please give me suggestions if you think this isn't the best way to
handle this :)

## Test Plan

Extended `C400.py` a little, and written the cases where:
- Code could be converted to one single conversion to `list` e.g.
`list(x for x in range(3))` -> `list(range(3))`
- Code couldn't be converted to one single conversion to `list` e.g.
`list(2 * x for x in range(3))` -> `[2 * x for x in range(3)]`
- `list` function is not built-in, and should not modify the code in any
way.
2024-03-15 14:34:18 +00:00
..
ruff Require --preview for ruff server (#10368) 2024-03-13 23:52:44 +00:00
ruff_benchmark Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_cache Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_dev Make --config and --isolated global flags (#10150) 2024-03-04 11:19:40 +00:00
ruff_diagnostics Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_formatter Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
ruff_index Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_linter [flake8_comprehensions] Handled special case for C400 which also matches C416 (#10419) 2024-03-15 14:34:18 +00:00
ruff_macros Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
ruff_notebook Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
ruff_python_ast Use ExprFString for StringLike::FString variant (#10311) 2024-03-14 13:30:22 +05:30
ruff_python_codegen Unify enums used for internal representation of quoting style (#10383) 2024-03-13 17:19:17 +00:00
ruff_python_formatter Unify enums used for internal representation of quoting style (#10383) 2024-03-13 17:19:17 +00:00
ruff_python_index Fix Indexer fails to identify continuation preceded by newline #10351 (#10354) 2024-03-12 00:35:41 -04:00
ruff_python_literal Unify enums used for internal representation of quoting style (#10383) 2024-03-13 17:19:17 +00:00
ruff_python_parser Unify enums used for internal representation of quoting style (#10383) 2024-03-13 17:19:17 +00:00
ruff_python_resolver Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_python_semantic Track conditional deletions in the semantic model (#10415) 2024-03-14 20:45:46 -04:00
ruff_python_stdlib [pylint] Include builtin warnings in useless-exception-statement (PLW0133) (#10394) 2024-03-13 15:26:11 -04:00
ruff_python_trivia Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
ruff_server Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
ruff_shrinking Bump version to v0.3.2 (#10304) 2024-03-09 00:24:22 +00:00
ruff_source_file ruff server - A new built-in LSP for Ruff, written in Rust (#10158) 2024-03-08 20:57:23 -08:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_workspace Remove F401 fix for __init__ imports by default and allow opt-in to unsafe fix (#10365) 2024-03-13 12:58:25 -05:00