ruff/crates/ruff_linter/src
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
..
checkers [`pylint`] Fix `PLR1708` false positives on nested functions (#21177) 2025-11-21 15:41:22 -05:00
comments Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
cst Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
docstrings Add missing docstring sections to the numpy list (#20931) 2025-10-24 17:19:30 -04:00
fix Update Rust crate anyhow to v1.0.100 (#20499) 2025-09-22 09:51:52 +02:00
importer [ty] Respect notebook cell boundaries when adding an auto import (#21322) 2025-11-13 18:58:08 +01:00
linter [`pylint`] Detect more exotic NaN literals in `PLW0177` (#18630) 2025-06-19 11:05:06 +00:00
message Set the diagnostic URL for lint errors (#21514) 2025-11-18 13:34:50 -05:00
registry Remove `Message::to_rule` (#18447) 2025-06-05 12:48:29 -04:00
rules [`flake8-implicit-str-concat`] Avoid invalid fix generated by autofix (`ISC003`) (#21517) 2025-11-21 17:22:35 -08:00
settings [`ruff`] Update schemars to v1 (#20942) 2025-10-20 08:59:52 +02:00
snapshots [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
codes.rs [`pylint`] Implement `stop-iteration-return` (`PLR1708`) (#20733) 2025-10-23 15:02:41 -07:00
directives.rs Track t-strings and f-strings for token-based rules and suppression comments (#20357) 2025-09-12 13:00:12 -05:00
doc_lines.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
fs.rs Render unsupported syntax errors in formatter tests (#20777) 2025-10-13 10:00:37 -04:00
lib.rs Combine `OldDiagnostic` and `Diagnostic` (#19053) 2025-07-03 13:01:09 -04:00
line_width.rs [`configuration`] Fix unclear error messages for line-length values exceeding `u16::MAX` (#21329) 2025-11-10 18:29:35 +00:00
linter.rs Add option to provide a reason to `--add-noqa` (#21294) 2025-11-11 14:03:46 +01:00
locator.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
logging.rs Display diffs for `ruff format --check` and add support for different output formats (#20443) 2025-09-30 12:00:51 -04:00
noqa.rs Add option to provide a reason to `--add-noqa` (#21294) 2025-11-11 14:03:46 +01:00
package.rs Detect empty implicit namespace packages (#14236) 2024-11-09 22:03:34 -05:00
packaging.rs Nested namespace packages support (#10541) 2024-03-24 22:53:32 -04:00
preview.rs [`flake8-bandit`] Support new PySNMP API paths (`S508`, `S509`) (#21374) 2025-11-19 15:03:23 -05:00
pyproject_toml.rs Rename `Diagnostic::syntax_error` methods, separate `Ord` implementation (#19179) 2025-07-08 09:54:19 -04:00
registry.rs Apply fix availability and applicability when adding to `DiagnosticGuard` and remove `NoqaCode::rule` (#18834) 2025-06-24 10:08:36 -04:00
renamer.rs Add a `ScopeKind` for the `__class__` cell (#20048) 2025-08-26 09:49:08 -04:00
rule_redirects.rs Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
rule_selector.rs Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
source_kind.rs Update MSRV to 1.85 and toolchain to 1.87 (#18126) 2025-05-16 09:19:55 +02:00
test.rs Standardize syntax error construction (#20903) 2025-10-16 11:56:32 -04:00
text_helpers.rs Handle non-printable characters in diff view (#11687) 2024-06-08 06:22:03 +00:00
upstream_categories.rs Fix pylint upstream categories not showing in docs (#10441) 2024-03-18 01:27:39 +00:00
violation.rs Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00