Pyrefly ignores suppressions after multi-line nested strings in f-strings
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
Pyrefly fails to recognize ignore comments if they appear after an f-string that contains a nested triple-quoted string spanning multiple lines e.g.
```python
# Corrupt the state with nested triple quotes in f-string
_ = f'start{"""message
"""}end'
y: int = "hello" # pyrefly: ignore[bad-assignment]
```
Pyrefly still errors in the last line.
### Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxAAQDCuATgwK7EAu1bAFjNXG6ja8A7hG7V08IZk4MIxWNQCOzXELjUI6amAC0-OegDmAHXQB9agF4dAcn6oGbYCZCvXAW3hojMM%2B7cQAF8YLFt-dDNSRE10DhtXHigoXFdqahoyBhgwKGjNI3RGXmxUTF1UODgIQq84sxAAGhAsnLzCNlwPKAoaAAVSbNzSPgwcAmoAY1x0SCNmBkEIGcIzGgBlGF4uNjZiOEQAekPW4cJGI0PQw8xcSbhD6dmahaWZw51GalQAN1RoVDYRRPOavNjLbS4dgQuCrdBkbgzXQ-GAMaozazUVwAZkIAEYAEzudAAbVRDEYcAAumZmOgIB5iIxpLpMBBspNwSjMbYakVsuF0EU2Lpsip2TBygBrGCkCqTSbeHnCRzoQXBZqoTkQFEAMWgMAoaCweCIZGCQA
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Research direction
Start with the sandbox reproduction in the issue and trace how Pyrefly handles ignore comments after nested triple-quoted strings inside f-strings. Done means the `pyrefly: ignore[bad-assignment]` comment suppresses the reported error for this example and a regression test covers the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100