Skip to content

Commit

Permalink
Merge 6b09bd0 into 11cae71
Browse files Browse the repository at this point in the history
  • Loading branch information
bdferris-v2 authored May 26, 2023
2 parents 11cae71 + 6b09bd0 commit 61b9a14
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,40 @@ public void testThatAllValidationNoticesAreDocumented() {
.isEmpty();
}

@Test
public void testThatAllValidationNoticesAreDocumentedWithFirstLine() {
List<Class<?>> noticesWithImproperMultilineDocComment =
discoverValidationNoticeClasses()
.filter(
clazz -> {
NoticeDocComments docComments = NoticeSchemaGenerator.loadComments(clazz);
if (docComments.getDocComment() == null) {
return false;
}
String[] lines = docComments.getDocComment().split("\n");
if (lines.length == 0) {
return false;
}
// The first line of the comment must be a single sentence.
return lines[0].contains(". ");
})
.collect(Collectors.toList());
assertWithMessage(
"We expect all validation notices to have a documentation comment of the "
+ "following form:\n"
+ "\n"
+ " Short single-sentence text describing the notice on a single line (required).\n"
+ " \n"
+ " Additional text further describing the notice with multiple additional sentences "
+ "on multiple lines(optional).\n"
+ "\n"
+ "See https://github.com/MobilityData/gtfs-validator/blob/master/docs/NEW_RULES.md#2-document-the-new-rule for more details.<br/>\n"
+ "\n"
+ "The following notice classes do not match that convention:")
.that(noticesWithImproperMultilineDocComment)
.isEmpty();
}

@Test
public void testThatValidationNoticesDoNotUseUnsupportedJavadocSyntax() {
List<String> noticesWithInvalidJavadoc =
Expand Down

0 comments on commit 61b9a14

Please sign in to comment.