Skip to content

Commit

Permalink
make violations read as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pfranza committed Jan 2, 2024
1 parent 767252c commit 35e5b21
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void findIconContentViolations(List<String> iconCharacterCodes, FileSet
if (line.contains("content")) {
String contentCode = extractContentCode(line);
if (contentCode != null && !iconCharacterCodes.contains(contentCode)) {
getLog().warn("Found violation in " + f + ": " + line.strip());
getLog().error("Found violation in " + f + ": " + line.strip());
if (failOnError) {
throw new MojoExecutionException("Icon violation found in " + f);
}
Expand Down Expand Up @@ -104,7 +104,7 @@ private void findIconViolations(List<String> iconClasses, FileSet fileSet) throw
for (org.jsoup.nodes.Element element : elementsWithIconClass) {
for(String className: element.className().split(" ")) {
if (className.startsWith("icon-") && !iconClasses.contains(className)) {
getLog().warn("Icon violation found in " + f + ": Class " + className + " is not in the allowed list.");
getLog().error("Icon violation found in " + f + ": Class " + className + " is not in the allowed list.");
if (failOnError) {
throw new MojoFailureException("Icon violation found: Class " + className + " is not in the allowed list.");
}
Expand Down

0 comments on commit 35e5b21

Please sign in to comment.