ruff
492d6767 - [`flake8-implicit-str-concat`] Avoid invalid fix generated by autofix (`ISC003`) (#21517)

Commit
18 days ago
[`flake8-implicit-str-concat`] Avoid invalid fix generated by autofix (`ISC003`) (#21517) ## Summary As reported in #19757: While attempting ISC003 autofix for an expression with explicit string concatenation, with either operand being a string literal that wraps across multiple lines (in parentheses) - it resulted in generating a fix which caused runtime error. Example: ``` _ = "abc" + ( "def" "ghi" ) ``` was being auto-fixed to: ``` _ = "abc" ( "def" "ghi" ) ``` which raised `TypeError: 'str' object is not callable` This commit makes changes to just report diagnostic - no autofix in such cases. Fixes #19757. ## Test Plan Added example scenarios in `crates/ruff_linter/resources/test/fixtures/flake8_implicit_str_concat/ISC.py`. Signed-off-by: Prakhar Pratyush <prakhar1144@gmail.com>
Author
Parents
Loading