Closed oleg-vinted closed 1 week ago
Interesting, does this happen when you just reference ADAPTER
alone? e.g.
class Foo
def foo
# should be a violation, but isn't:
Bar::ADAPTER
end
end
module Bar
ADAPTER = 1
end
Both Bar::ADAPTER
and Bar::ADAPTER['default']
are detected as violations by Packs. Only after adding ::INSTANCE
on top of that Packs no longer can detect the violation.
Interesting – my guess is something in the reference collection logic isn't picking that up as a reference in that case. I could look into it at some point but also feel free to shoot a PR over and will look at it right away!
Here's an example, we have two files in two different packages, with no dependencies defined:
Bar::ADAPTER
should be a violation, but it's not detected by Packs. Packwerk does detect this violation.Minimal reproduction repo: https://github.com/oleg-vinted/packs-repro.