From f188cfe0c4a815b864dfaf8c71f6e156295c84ab Mon Sep 17 00:00:00 2001 From: mnhock Date: Fri, 12 Jul 2024 07:58:04 +0200 Subject: [PATCH] Rules checking annotated with should reside in and outside package miss description Closes gh-74 --- src/main/java/com/enofex/taikai/java/JavaConfigurer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/enofex/taikai/java/JavaConfigurer.java b/src/main/java/com/enofex/taikai/java/JavaConfigurer.java index 5906934..89e2e1b 100644 --- a/src/main/java/com/enofex/taikai/java/JavaConfigurer.java +++ b/src/main/java/com/enofex/taikai/java/JavaConfigurer.java @@ -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) { @@ -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,