This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a step that publishes warnings.
- Loading branch information
Showing
11 changed files
with
139 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/resources/io/jenkins/plugins/checkstyle/steps/PublishWarningsStep/config.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" | ||
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:u="/util"> | ||
|
||
<f:entry title="${%title.usePreviousBuildAsReference}" description="${%description.usePreviousBuildAsReference}" | ||
field="usePreviousBuildAsReference"> | ||
<f:checkbox/> | ||
</f:entry> | ||
<f:entry title="${%title.onlyUseStableBuildsAsReference}" description="${%description.onlyUseStableBuildsAsReference}" | ||
field="useStableBuildAsReference"> | ||
<f:checkbox/> | ||
</f:entry> | ||
<u:defaultEncoding id="warnings"/> | ||
|
||
</j:jelly> |
11 changes: 11 additions & 0 deletions
11
src/main/resources/io/jenkins/plugins/checkstyle/steps/PublishWarningsStep/config.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
title.onlyUseStableBuildsAsReference=Only use stable builds as reference | ||
description.onlyUseStableBuildsAsReference=Use the last stable build as the reference to compute the number of new \ | ||
warnings against. This allows to ignore interim unstable builds for which the number of warnings \ | ||
decreased. Note that the last stable build is evaluated only by inspecting the unit test failures. \ | ||
The static analysis results are not considered. | ||
title.usePreviousBuildAsReference=Use previous build as reference | ||
description.usePreviousBuildAsReference=If set the number of new warnings will always be computed based on the \ | ||
previous build, even if that build is unstable (due to a violated warning threshold). \ | ||
Otherwise the last build that did not violate any \ | ||
given threshold will be used as reference. It is recommended to uncheck this option if \ | ||
the plug-in should ensure that all new warnings will be finally fixed in subsequent builds. |
9 changes: 9 additions & 0 deletions
9
...in/resources/io/jenkins/plugins/checkstyle/steps/PublishWarningsStep/config_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
title.onlyUseStableBuildsAsReference=Nur stabile Builds als Referenz nutzen | ||
description.onlyUseStableBuildsAsReference=Die Anzahl der neuen Warnungen wird auf Basis des letzten stabilen Builds \ | ||
bestimmt (Achtung: die Stabilität bezieht sich nicht auf die statische Analyse sondern nur auf die Ergebnisse \ | ||
der Unit Tests). Dadurch lässt sich ein instabiler Build rückgängig machen, ohne dass die Berechnung der Warnungen \ | ||
beeinflusst wird. | ||
title.usePreviousBuildAsReference=Letzten Build als Referenz nutzen | ||
description.usePreviousBuildAsReference=Falls aktiviert, wird die Anzahl der neuen Warnungen auf Basis des letzten Builds \ | ||
bestimmt. Normalerweise wird die Anzahl der neuen Warnungen durch einen Vergleich mit dem Referenzbuild ermittelt,\ | ||
d.h. mit dem Build, bei dem die neuen Warnungen das erste Mal erschienen sind. |
14 changes: 10 additions & 4 deletions
14
src/test/java/hudson/plugins/checkstyle/CheckstyleResultTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
package hudson.plugins.checkstyle; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.plugins.analysis.core.BuildHistory; | ||
import hudson.model.Run; | ||
import hudson.plugins.analysis.core.HistoryProvider; | ||
import hudson.plugins.analysis.core.ParserResult; | ||
import hudson.plugins.analysis.core.ReferenceProvider; | ||
import hudson.plugins.analysis.test.BuildResultTest; | ||
|
||
/** | ||
* Tests the class {@link CheckStyleResult}. | ||
*/ | ||
public class CheckstyleResultTest extends BuildResultTest<CheckStyleResult> { | ||
@Override | ||
protected CheckStyleResult createBuildResult(final AbstractBuild<?, ?> build, final ParserResult project, final BuildHistory history) { | ||
return new CheckStyleResult(build, history, project, "UTF8", false); | ||
protected CheckStyleResult createBuildResult(final Run<?, ?> build, final ParserResult project, final ReferenceProvider referenceProvider, final HistoryProvider historyProvider) { | ||
return new CheckStyleResult(build, referenceProvider, project, "UTF8", false) { | ||
@Override | ||
protected HistoryProvider createBuildHistory(final Run<?, ?> build) { | ||
return historyProvider; | ||
} | ||
}; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters