ruff/crates/ruff_linter/src/rules
Prakhar Pratyush 492d676736
[`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>
2025-11-21 17:22:35 -08:00
..
airflow [`airflow`] extend deprecated argument `concurrency` in `airflow..DAG` (`AIR301`) (#21220) 2025-11-03 15:20:20 -05:00
eradicate Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
fastapi Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_2020 Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_annotations [`flake8-annotations`] Add link to `allow-star-arg-any` option (`ANN401`) (#21326) 2025-11-07 18:45:53 -05:00
flake8_async Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_bandit [`flake8-bandit`] Support new PySNMP API paths (`S508`, `S509`) (#21374) 2025-11-19 15:03:23 -05:00
flake8_blind_except Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_boolean_trap Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_bugbear [`flake8-bugbear`] Mark fix as unsafe for non-NFKC attribute names (`B009`, `B010`) (#21131) 2025-11-03 14:45:23 +00:00
flake8_builtins Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_commas Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_comprehensions [`flake8-comprehensions`] Fix typo in `C416` documentation (#21184) 2025-11-03 14:04:59 -05:00
flake8_copyright Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_datetimez Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_debugger Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_django [`flake8-django`] Apply `DJ001` to annotated fields (#20907) 2025-10-27 09:19:15 +01:00
flake8_errmsg Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_executable Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_fixme Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_future_annotations Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_gettext Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_implicit_str_concat [`flake8-implicit-str-concat`] Avoid invalid fix generated by autofix (`ISC003`) (#21517) 2025-11-21 17:22:35 -08:00
flake8_import_conventions Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
flake8_logging Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_logging_format Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_no_pep420 Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_pie Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_print Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_pyi [`flake8-pyi`] Fix PYI034 to not trigger on metaclasses (`PYI034`) (#20881) 2025-10-24 13:40:26 +00:00
flake8_pytest_style Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
flake8_quotes Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
flake8_raise Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_return Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_self Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_simplify [`flake8-simplify`] Apply `SIM113` when index variable is of type `int` (#21395) 2025-11-12 17:54:39 +00:00
flake8_slots Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_tidy_imports Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
flake8_todos Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_type_checking [`flake8-type-checking`] Fix `TC003` false positive with `future-annotations` (#21125) 2025-10-30 14:14:29 -04:00
flake8_unused_arguments Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flake8_use_pathlib Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
flynt Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
isort Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
mccabe Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
numpy Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
pandas_vet Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
pep8_naming Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
perflint Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
pycodestyle Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
pydoclint [`pydoclint`] Fix false positive when Sphinx directives follow Raises section (`DOC502`) (#20535) 2025-11-12 21:37:55 +00:00
pydocstyle Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
pyflakes [`pyflakes`] Revert to stable behavior if imports for module lie in alternate branches for `F401` (#20878) 2025-10-27 10:23:36 -05:00
pygrep_hooks Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
pylint [`pylint`] Fix suppression for empty dict without tuple key annotation (`PLE1141`) (#21290) 2025-11-21 22:07:18 +00:00
pyupgrade `UP035`: Consistently set the deprecated tag (#21396) 2025-11-12 08:17:29 +01:00
refurb [`refurb`] Fix `FURB103` autofix (#21454) 2025-11-16 09:32:41 +01:00
ruff [`ruff`] Catch more dummy variable uses (`RUF052`) (#19799) 2025-11-21 12:57:02 -05:00
tryceratops Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
mod.rs Re-enable clippy `useless-format` (#14095) 2024-11-04 18:25:25 +01:00