From 7050a288860a44bf7392b297a389361a65a8a79c Mon Sep 17 00:00:00 2001 From: Todd Ogin Date: Tue, 29 Jan 2013 11:03:49 -0500 Subject: [PATCH] Fixes issue #14 https://github.com/philmander/ant-jshint/issues/14 was reported by me. I specified the code change in a comment and then decided to try to fix it. --- .../philmander/jshint/report/PlainJsHintReporter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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"); }