Conversation
this.xmlReportFile = xmlReportFile | ||
} | ||
|
||
void setViolations(Violations violations) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh this reminds me of the PMD source code
} | ||
|
||
File getHtmlReportFile() { | ||
new File(xmlReportFile.absolutePath - '.xml' + '.html') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool syntax
@Override | ||
void collectViolations(File xmlReportFile, File htmlReportFile, Violations violations) { | ||
PmdViolationsEvaluator evaluator = new PmdViolationsEvaluator(xmlReportFile) | ||
int errors = 0, warnings = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just because you can, doesn't mean you should
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoL, I tried.
@@ -44,6 +44,29 @@ public class CheckstyleIntegrationTest { | |||
} | |||
|
|||
@Test | |||
public void shouldFailBuildAgainWhenCheckstyleWarningsStillOverTheThresholdAfterSecondRun() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
might be nice to word it differently tho
afterSecondRunWhenStillOverTheThresholdThenTheBuildFailsAgain
or if you insist on starting with should:
shouldFailTheBuildAfterSecondRunWhenStillOverTheThreshold
|
||
import org.gradle.api.tasks.JavaExec | ||
|
||
class GenerateFindBugsHtmlReport extends JavaExec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
nice set of tests for each plugin, LGTM ! 👍 |
Scope of the PR
As @ouchadam mentioned in issue #11:
This shouldn't happen because code is identical, therefore should yield the same results. As already mentioned in #11, after a quick investigation:
Considerations and implementation
Each analysis task (
Checkstyle
,Findbugs
,Pmd
) is now depending on a specific implementation ofCollectionViolationsTask
that will perform the same action before provided asdoLast
. This will allow to evaluate the reports and collect the violations even when the analysis are skipped because their input haven't changed.Test(s) added
For each tool supported by the plugin an integration test has been added to ensure that 2 consecutive runs without any change in the code yield the same result.