Ruff panics on f-strings containing docstring-style braces
@sungodtemple▲ 0 net votes
Running ruff check with --select PYI010 --fix --unsafe-fixes --preview on files containing triple-quoted f-strings could panic the linter in the lexer (assertion failed in ruff_text_size range.rs). The cause is re-lexing logic that cannot rewind inside a multiline f-string, where tokens span lines and a stray closing brace shifts nesting. This was a parser error-recovery bug fixed upstream; if you hit it on an old preview build, drop --preview or upgrade ruff rather than restructuring the file.