Skip to content

Commit

Permalink
Rules checking annotated with should reside in and outside package mi…
Browse files Browse the repository at this point in the history
…ss description

Closes gh-74
  • Loading branch information
mnhock authored and mnhock committed Jul 12, 2024
1 parent 59a04fb commit c8a8e9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/enofex/taikai/java/JavaConfigurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public JavaConfigurer classesShouldResideInPackage(String regex, String packageI
Configuration configuration) {
return addRule(TaikaiRule.of(classes()
.that().haveNameMatching(regex)
.should().resideInAPackage(packageIdentifier), configuration));
.should().resideInAPackage(packageIdentifier)
.as("Classes have name matching %s should reside in package %s".formatted(
regex, packageIdentifier)), configuration));
}

public JavaConfigurer classesShouldResideOutsidePackage(String regex, String packageIdentifier) {
Expand All @@ -86,7 +88,9 @@ public JavaConfigurer classesShouldResideOutsidePackage(String regex, String pac
Configuration configuration) {
return addRule(TaikaiRule.of(classes()
.that().haveNameMatching(regex)
.should().resideOutsideOfPackage(packageIdentifier), configuration));
.should().resideOutsideOfPackage(packageIdentifier)
.as("Classes have name matching %s should reside outside package %s".formatted(
regex, packageIdentifier)), configuration));
}

public JavaConfigurer classesShouldBeAnnotatedWith(String regex,
Expand Down

0 comments on commit c8a8e9e

Please sign in to comment.