diff --git a/src/main/java/com/philmander/jshint/report/PlainJsHintReporter.java b/src/main/java/com/philmander/jshint/report/PlainJsHintReporter.java index 0a1fde0..fc7be7f 100644 --- a/src/main/java/com/philmander/jshint/report/PlainJsHintReporter.java +++ b/src/main/java/com/philmander/jshint/report/PlainJsHintReporter.java @@ -30,12 +30,13 @@ public String createReport() { if (report.getTotalErrors() > 0) { output.append("----------------------------------------------------------------------\n"); for(JsHintResult result : report.getResults()) { - output.append("\n"); - output.append(getFileFailureMessage((result.getFile()) + "\n")); - for(JsHintError error : result.getErrors()) { - output.append(getIssueMessage(error.getReason(), error.getEvidence(), error.getLine(), error.getCharacter()) + "\n"); + if(result.getNumErrors() > 0) { + output.append("\n"); + output.append(getFileFailureMessage((result.getFile()) + "\n")); + for(JsHintError error : result.getErrors()) { + output.append(getIssueMessage(error.getReason(), error.getEvidence(), error.getLine(), error.getCharacter()) + "\n"); + } } - } output.append("----------------------------------------------------------------------\n"); }