Skip to content

Generate # pyrefly: ignore[code] without a space before the bracket - #4992

Open
Aniketsy wants to merge 1 commit into
facebook:mainfrom
Aniketsy:fix-4991
Open

Aniketsy wants to merge 1 commit into
facebook:mainfrom
Aniketsy:fix-4991

Conversation

@Aniketsy

Copy link
Copy Markdown

Summary

pyrefly suppress were adding comments like # pyrefly: ignore [code] (with a space), but the docs use # pyrefly: ignore[code] (no space). This PR makes both generate the no-space style, as discussed in the issue.

comments with a space still work, nothing changes for existing code.

Fixes #4991

Test Plan

  • Updated the existing tests and added a few new ones to check that comments with a space are still accepted.
  • Ran cargo test -p pyrefly suppress and cargo test -p pyrefly code_actions.

@meta-cla

meta-cla Bot commented Sep 20, 2026

Copy link
Copy Markdown

Hi @Aniketsy!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla

meta-cla Bot commented Sep 20, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Sep 20, 2026
@Aniketsy Aniketsy changed the title Generate '# pyrefly: ignore[code]' without a space before the bracket Generate # pyrefly: ignore[code] without a space before the bracket Sep 20, 2026
@stroxler stroxler assigned stroxler and unassigned NathanTempest Sep 21, 2026
@meta-codesync

meta-codesync Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@stroxler has imported this pull request. If you are a Meta employee, you can view this in D121014501. (Because this pull request was imported automatically, there will not be any future comments.)

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

I'll aim to get a second review and merge it soon.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@grievejia grievejia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs and pyrefly suppress use different spacing in ignore comments

4 participants