Skip to content

Add support for grouped rules #95

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkjensen
Copy link

Summary

Invoke rules defined by fields of type ArchTests which include rules defined in other classes.

See also https://www.archunit.org/userguide/html/000_Index.html#_grouping_rules

Fixes #70

Details

Extended InvokableRules to also support ArchTests.

Context

Checklist:

Related issue :

#70

@mkjensen mkjensen mentioned this pull request Mar 11, 2025
3 tasks
Invoke rules defined by fields of type ArchTests which include rules defined in other classes.

See also https://www.archunit.org/userguide/html/000_Index.html#_grouping_rules

Fixes societe-generale#70
@@ -105,11 +131,11 @@ InvocationResult invokeOn(JavaClasses importedClasses) {

InvocationResult result = new InvocationResult();
for (Method method : archRuleMethods) {
checkForFailure(() -> invoke(method, instance, importedClasses))
checkForFailure(() -> invoke(method, null, importedClasses))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ArchUnit examples use static fields and methods so no need for an instance here.

If it turns out an instance is needed, then more work is needed.

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.

Support for grouping rules
1 participant