From 35cc4ea569b8434608a99f2e5100123f835744dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Nowak?= Date: Tue, 26 Jan 2016 18:40:33 +0100 Subject: [PATCH 1/2] Checkstyle bumped to version 6.14.1 --- build.gradle | 2 +- .../sputnik/processor/checkstyle/CheckstyleProcessor.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index d10538c3..726b4f85 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ dependencies { compile 'com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.8.5' // Checkstyle dependencies - compile 'com.puppycrawl.tools:checkstyle:6.6' + compile 'com.puppycrawl.tools:checkstyle:6.14.1' // PMD dependencies compile('net.sourceforge.pmd:pmd-dist:5.2.1') { diff --git a/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java b/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java index fa8b0ba2..48df9735 100644 --- a/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java +++ b/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java @@ -45,7 +45,11 @@ public String getName() { private void innerProcess(@NotNull Review review, @NotNull AuditListener auditListener) { List files = review.getFiles(new JavaFilter(), new IOFileTransformer()); Checker checker = createChecker(auditListener); - checker.process(files); + try { + checker.process(files); + } catch(CheckstyleException e) { + throw new ReviewException("Unable to process files with Checkstyle", e); + } checker.destroy(); } From ac71954a5ae200c2a2ea8b62725a8dc4aab0a4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Nowak?= Date: Wed, 27 Jan 2016 09:26:30 +0100 Subject: [PATCH 2/2] Fix for checkstyle violation (detected by Sputnik) --- .../touk/sputnik/processor/checkstyle/CheckstyleProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java b/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java index 48df9735..aa4fbb9a 100644 --- a/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java +++ b/src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleProcessor.java @@ -47,7 +47,7 @@ private void innerProcess(@NotNull Review review, @NotNull AuditListener auditLi Checker checker = createChecker(auditListener); try { checker.process(files); - } catch(CheckstyleException e) { + } catch (CheckstyleException e) { throw new ReviewException("Unable to process files with Checkstyle", e); } checker.destroy();