Skip to content

Keep public re-exports from excluded files in pyrefly coverage --public-only#4133

Closed
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-4034
Closed

Keep public re-exports from excluded files in pyrefly coverage --public-only#4133
jorenham wants to merge 1 commit into
facebook:mainfrom
jorenham:gh-4034

Conversation

@jorenham

Copy link
Copy Markdown
Contributor

Summary

--project-excludes is applied at file discovery, so an excluded module never produced a report, even when a non-excluded public module re-exports from it. pyrefly coverage {check, report} --public-only now collects such re-export origins in a second pass, so a symbol is only excluded when all of its public re-export locations are excluded.

Fixes #4034

Alternative to #4048

Test Plan

Regression tests added, and verified that this does not change any of the results for scipy-stubs and numpy.

@meta-cla meta-cla Bot added the cla signed label Jul 13, 2026
@jorenham jorenham changed the title Keep public re-exporte from excluded files in pyrefly coverage --public-only Keep public re-exports from excluded files in pyrefly coverage --public-only Jul 13, 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. ✅

@kinto0 kinto0 self-assigned this Jul 14, 2026
@meta-codesync

meta-codesync Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

@yangdanny97 yangdanny97 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 d22c71c Jul 14, 2026
@meta-codesync meta-codesync Bot added the Merged label Jul 14, 2026
@meta-codesync

meta-codesync Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@kinto0 merged this pull request in d22c71c.

@jorenham jorenham deleted the gh-4034 branch July 14, 2026 20:58
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.

pyrefly coverage check --public-only: --project-excludes shouldn't exclude public re-exports

3 participants