Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-tylenda-sonarsource committed Dec 19, 2024
1 parent 712a0ad commit 1b751f8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ public void visitNode(Tree tree) {
getSilentlyIgnoredAnnotation(symbolMetadata, annotationName)
.ifPresent(
annotationTree -> {
String shortName = annotationTypeIdentifier(annotationName);
String message = String.format(
"Either add an explanation about why this test is skipped or remove the \"@%s\" annotation.",
annotationTypeIdentifier(annotationName)
shortName
);
List<JavaFileScannerContext.Location> secondaryLocation =
Collections.singletonList(new JavaFileScannerContext.Location("Cause", annotationTree));
context.reportIssue(this, methodTree.simpleName(), message, secondaryLocation, null);
JavaFileScannerContext.Location secondaryLocation =
new JavaFileScannerContext.Location(String.format("@%s annotation skips the test", shortName), annotationTree);
context.reportIssue(this, methodTree.simpleName(), message, Collections.singletonList(secondaryLocation), null);
}
);
}
Expand Down

0 comments on commit 1b751f8

Please sign in to comment.