ruff/crates/ruff_python_ast
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
..
src Add Iterator impl for StringLike parts (#11399) 2024-05-13 15:52:03 +00:00
Cargo.toml Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00