Dedupe symbol count fields in pyrefly coverage#3771
Conversation
|
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 @jorenham for your continued refactoring and improvements in pyrefly coverage. Pulling the eight repeated count fields into SymbolCounts with #[serde(flatten)] mirrors the existing SlotCounts pattern perfectly, and I confirmed it's output-identical (2 files changed, zero snapshot diffs). The merge() helper cleanly replaces the manual summation, and the n_type_ignores preservation in filter_module_report_to_public is handled correctly. LGTM, importing and merging.
|
@NathanTempest has imported this pull request. If you are a Meta employee, you can view this in D108620077. |
yangdanny97
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@NathanTempest merged this pull request in e4ad5a5. |
Summary
The
ModuleReportandReportSummarystructs both had the same 8n_{symbol}count fields, which were modified incollect.rsone by one in three functions. So if you wanted to add a new symbol counter, you'd have to do so in 5 places.This dedupes these fields using he same
#[serde(flatten)]trick used for the "slot" (typable) counts.This is purely a refactor; so there are no behavior changes.
This shouldn't cause any merge conflicts with #3747.
Test Plan
Tests still pass.