-
-
Notifications
You must be signed in to change notification settings - Fork 47
Add rule for exact matching of namespaces #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #554 +/- ##
============================================
+ Coverage 97.74% 97.80% +0.05%
- Complexity 614 658 +44
============================================
Files 79 81 +2
Lines 1775 1913 +138
============================================
+ Hits 1735 1871 +136
- Misses 40 42 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It seems ok for me, what about adding few lines in the readme to document it? |
Updated README.md to include documentation for the two new namespace matching rules introduced in the previous commit: - ResideInOneOfTheseNamespacesExactly - NotResideInOneOfTheseNamespacesExactly The documentation includes: - Clear descriptions of how exact matching differs from recursive matching - Code examples showing typical use cases - Visual examples demonstrating what matches and what doesn't These rules address issue #406 by providing stricter namespace validation options.
|
Great point, thanks! |
AlessandroMinoccheri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This commit adds two new expression rules to support exact namespace matching, addressing the feature request in issue #406:
The existing rules (ResideInOneOfTheseNamespaces and NotResideInTheseNamespaces) match recursively, including all child namespaces. The new rules provide an exact match option for stricter architectural constraints.
fixes #406