Skip to content

Exclude privately-named classes from pyrefly coverage#4249

Closed
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:coverage/exclude-private-classes
Closed

Exclude privately-named classes from pyrefly coverage#4249
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:coverage/exclude-private-classes

Conversation

@jorenham

Copy link
Copy Markdown
Collaborator

Summary

Privately-named functions, variables, methods, and attrs were already excluded, but privately-named classes weren't, so e.g. _Foo.bar was still reported.
A private name now hides its whole subtree unless exported via __all__, consistent with the other symbol kinds and with the documented behavior.

Test Plan

Regression tests added.

@jorenham jorenham added the coverage Issues related to `pyrefly coverage`, `pyrefly report` label Jul 22, 2026
@meta-cla meta-cla Bot added the cla signed label Jul 22, 2026
@jorenham
jorenham force-pushed the coverage/exclude-private-classes branch from b75b6ad to 14196aa Compare July 22, 2026 15:15
@github-actions github-actions Bot added size/m and removed size/m labels Jul 22, 2026
@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. ✅

@meta-codesync

meta-codesync Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@samwgoldman has imported this pull request. If you are a Meta employee, you can view this in D113438823.

@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.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in cb5057b Jul 24, 2026
@meta-codesync

meta-codesync Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@samwgoldman merged this pull request in cb5057b.

@meta-codesync meta-codesync Bot added the Merged label Jul 24, 2026
@jorenham
jorenham deleted the coverage/exclude-private-classes branch July 24, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed coverage Issues related to `pyrefly coverage`, `pyrefly report` Merged quansight size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants