ruff
9d167a1f - Slice source code instead of generating it for `EM` fixes (#7746)

Commit
1 year ago
Slice source code instead of generating it for `EM` fixes (#7746) ## Summary This PR fixes the bug where the generated fix for `EM*` rules would replace a triple-quoted (f-)string with a single-quoted (f-)string. This changes the semantic of the string in case it contains a single-quoted string literal. This is especially evident with f-strings where the expression could contain another string within it. For example, ```python f"""normal {"another"} normal""" ``` ## Test Plan Add test case for triple-quoted string and update the snapshots. fixes: #6988 fixes: #7736
Author
Parents
Loading