fabiodomingues / clj-depend

A Clojure namespace dependency analyzer
Eclipse Public License 2.0
78 stars 8 forks source link

Fix false violation for unspecified namespaces #31

Closed dundalek closed 1 year ago

dundalek commented 1 year ago

When running the latest version, I noticed we introduced a regression in #30 which results in namespaces not covered in any layer (like libraries) being reported as violations.

The cause is when layer config does not contain :accessed-by-layers then due to when-let the result from dependency-layer-can-be-accessed-by-layer? will be nil, which is then negated in violate?. Same thing applies for layer-can-access-dependency-layer?.

To fix it I flipped the negation.

Checklist

dundalek commented 1 year ago

This might actually still be broken when mixing both :access-layers and :accessed-by-layers.

dundalek commented 1 year ago

Nice catch @dundalek! I'm really enjoying our partnership.

@fabiodomingues Likewise, great to meet someone from the Clojure community with interest in this topic.