Separate filtering from reference extraction
wildmaples opened this issue · 0 comments
wildmaples commented
We currently extract + filter references all in one step, which can sometimes be a point of confusion.
In particular, we do a lot of filtering:
packwerk/lib/packwerk/reference_extractor.rb
Lines 50 to 71 in c6b06b8
You can see we remove
- locally referenced constants,
- references to constants packwerk is unable to resolve, or unable to resolve to a package, and
- references to constants in the same package as the source package of the reference.
There could be a light refactor here so that we can extract all references, followed by another layer to do the filtering. It should lend itself to easier testing and a lighter set of test suites.