Skip to content

pyrefly coverage report locates suppressions at the first # on the line #4022

Description

@jorenham

parse_suppressions uses line.find('#'), which can hit a # inside a string literal:

x: str = "#hash"  # type: ignore
"type_ignores": [{"kind": "type", "codes": [], "location": {"line": 1, "column": 11}}]

Column 11 is the # in "#hash"; the comment starts at column 19. ignore.rs already has a
quote-aware find_comment_start.

Metadata

Metadata

Assignees

Labels

coverageIssues related to `pyrefly coverage`, `pyrefly report`quansight

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions