Skip to content

Conversation

@fain182
Copy link
Collaborator

@fain182 fain182 commented Dec 27, 2025

This commit adds two new expression rules to support exact namespace matching, addressing the feature request in issue #406:

  • ResideInOneOfTheseNamespacesExactly: Validates that classes reside in one of the specified namespaces exactly, without matching child namespaces
  • NotResideInOneOfTheseNamespacesExactly: The inverse rule that validates classes do NOT reside in the specified namespaces exactly

The existing rules (ResideInOneOfTheseNamespaces and NotResideInTheseNamespaces) match recursively, including all child namespaces. The new rules provide an exact match option for stricter architectural constraints.

This commit adds two new expression rules to support exact namespace
matching, addressing the feature request in issue #406:

- ResideInOneOfTheseNamespacesExactly: Validates that classes reside
  in one of the specified namespaces exactly, without matching child
  namespaces
- NotResideInOneOfTheseNamespacesExactly: The inverse rule that
  validates classes do NOT reside in the specified namespaces exactly

The existing rules (ResideInOneOfTheseNamespaces and
NotResideInTheseNamespaces) match recursively, including all child
namespaces. The new rules provide an exact match option for stricter
architectural constraints.

Implementation:
- Added namespaceMatchesExactly() method to ClassDescription
- Created ResideInOneOfTheseNamespacesExactly expression class
- Created NotResideInOneOfTheseNamespacesExactly expression class
- Added comprehensive test coverage for both new rules
- All existing tests continue to pass
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.78%. Comparing base (730d429) to head (51ba7c5).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #554      +/-   ##
============================================
+ Coverage     97.74%   97.78%   +0.04%     
- Complexity      614      627      +13     
============================================
  Files            79       81       +2     
  Lines          1775     1809      +34     
============================================
+ Hits           1735     1769      +34     
  Misses           40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants