Add rule for exact matching of namespaces#554
Merged
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:
|
Member
|
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.
Collaborator
Author
|
Great point, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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