ruff/crates
Dhruv Manilawala 0dc130e841
Add Iterator impl for StringLike parts (#11399)
## Summary

This PR adds support to iterate over each part of a string-like
expression.

This similar to the one in the formatter:


128414cd95/crates/ruff_python_formatter/src/string/any.rs (L121-L125)

Although I don't think it's a 1-1 replacement in the formatter because
the one implemented in the formatter has another information for certain
variants (as can be seen for `FString`).

The main motivation for this is to avoid duplication for rules which
work only on the parts of the string and doesn't require any information
from the parent node. Here, the parent node being the expression node
which could be an implicitly concatenated string.

This PR also updates certain rule implementation to make use of this and
avoids logic duplication.
2024-05-13 15:52:03 +00:00
..
red_knot Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_benchmark Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_cache Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_dev Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_diagnostics Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_formatter Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_linter Add Iterator impl for StringLike parts (#11399) 2024-05-13 15:52:03 +00:00
ruff_macros Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_notebook Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_ast Add Iterator impl for StringLike parts (#11399) 2024-05-13 15:52:03 +00:00
ruff_python_ast_integration_tests Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_codegen Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_formatter Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_literal Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_parser Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_stdlib Migrate sys.rs generation to stdlibs (#11374) 2024-05-12 21:21:51 -04:00
ruff_python_trivia Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_trivia_integration_tests Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_server Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_source_file Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_workspace Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00