Skip to content

Docs and pyrefly suppress use different spacing in ignore comments #4991

Description

@Aniketsy

The docs show # pyrefly: ignore[bad-return] (no space), but pyrefly suppress generates # pyrefly: ignore [bad-return] (with a space).

Both forms work, but the docs never say the space is optional, so the mismatch looks confusing.

Suggested fix: maybe we can just add a note like this after

This is equivalent to `pyrefly check --suppress-errors`.

The generated comments use the form `# pyrefly: ignore [error-code]`, with a space before
the bracket. This is equivalent to the `# pyrefly: ignore[error-code]` form shown above, and
Pyrefly accepts both.

happy to send a PR, if this looks correct or please let me know if it needs changes. Thanks :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions