Support typed ignore-errors directives#3944
Conversation
Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
NathanTempest
left a comment
There was a problem hiding this comment.
Thanks @WilliamK112, welcome, and nice work. Reusing Suppression so file-level ignore-errors[code] shares the exact same representation and bracket-parsing as line-level ignore[code] is the right call, and keeping ignore-errors[code] Pyrefly-only (blanket for mypy/pyre) matches those tools' real semantics. LGTM for importing.
One possible follow-up: parse_ignore_all_kind duplicates the split(',')/trim bracket parse from parse_ignore_comment could share a helper someday. I will address this after importing this PR, nothing for you to do and thank you for the fix
|
@NathanTempest has imported this pull request. If you are a Meta employee, you can view this in D110063592. |
kinto0
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary
# pyrefly: ignore-errors[code]as a file-level suppression for selected Pyrefly error codes.Suppressionrepresentation for file-level directives so whole-file and line-level Pyrefly code matching share the same semantics, including parent suppression names.ignore-errorsdirectives as blanket-only and document the new Pyrefly form.Fixes #3723
Notes
This is scoped to file-level code filtering for
pyrefly: ignore-errors. Related suppression lint/reporting PRs (#3832 and #3797) address separate diagnostics and unused-ignore behavior.Validation
cargo fmt --checkgit diff --checkcargo test -p pyrefly_python test_parse_ignore_allCARGO_TARGET_DIR=/Users/William/pyrefly-target-codex cargo test -p pyrefly test_pyrefly_top_level_ignore_typed