mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Update checkResultsPublish.md
This commit is contained in:
parent
9d4a9304db
commit
d691c8d2cf
@ -9,9 +9,115 @@ This step can publish static check results from various sources.
|
||||
## Parameters
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ---------------|-----------|-----------------------------------|--------------------|
|
||||
| | | | |
|
||||
| aggregation | no | `true` | see below |
|
||||
| tasks | no | `false` | see below |
|
||||
| pmd | no | `false` | see below |
|
||||
| cpd | no | `false` | see below |
|
||||
| findbugs | no | `false` | see below |
|
||||
| checkstyle | no | `false` | see below |
|
||||
| eslint | no | `false` | see below |
|
||||
| pylint | no | `false` | see below |
|
||||
| archive | no | `false` | `true`, `false` |
|
||||
|
||||
* `<parameter>` - Detailed description of each parameter.
|
||||
* `aggregation` - Publishes .
|
||||
* `tasks` - Searches and publishes TODOs in files with the [Task Scanner Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Task+Scanner+Plugin).
|
||||
* `pmd` - Publishes PMD findings with the [PMD plugin](https://plugins.jenkins.io/pmd) .
|
||||
* `cpd` - Publishes CPD findings with the [DRY plugin](https://plugins.jenkins.io/dry).
|
||||
* `findbugs` - Publishes Findbugs findings with the [Findbugs plugin](https://plugins.jenkins.io/findbugs).
|
||||
* `checkstyle` - Publishes Checkstyle findings with the [Checkstyle plugin](https://plugins.jenkins.io/checkstyle).
|
||||
* `eslint` - Publishes ESLint findings (in [JSLint format](https://eslint.org/docs/user-guide/formatters/)) with the [Warnings plugin](https://plugins.jenkins.io/warnings).
|
||||
* `pylint` - Publishes PyLint findings with the [Warnings plugin](https://plugins.jenkins.io/warnings), pylint needs to run with `--output-format=parseable` option.
|
||||
|
||||
Each of the parameters `aggregation`, `tasks`, `pmd`, `cpd`, `findbugs`, `checkstyle`, `eslint` and `pylint` can be set to `true` or `false` but also to a map of parameters to hand in different settings for the tools.
|
||||
|
||||
**aggregation**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**tasks**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/*.java'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| high | no | `'FIXME'` | |
|
||||
| normal | no | `'TODO,REVISE,XXX'` | |
|
||||
| low | no | | |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**pmd**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/target/pmd.xml'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**cpd**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/target/cpd.xml'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**findbugs**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/target/findbugsXml.xml, **/target/findbugs.xml'` | |
|
||||
| archive | no | `true` | true, false |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**checkstyle**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/target/checkstyle-result.xml'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**eslint**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/eslint.jslint.xml'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
**pylint**
|
||||
|
||||
| parameter | mandatory | default | possible values |
|
||||
| ----------|-----------|---------|-----------------|
|
||||
| pattern | no | `'**/pylint.log'` | |
|
||||
| archive | no | `true` | `true`, `false` |
|
||||
| thresholds | no | none | see [thresholds](#thresholds) |
|
||||
|
||||
### Thresholds
|
||||
|
||||
It is possible to define thresholds to fail the build on a certain count of findings. To achive this, just define your thresholds a followed for the specific check tool:
|
||||
|
||||
```groovy
|
||||
thresholds: [fail: [all: 999, low: 99, normal: 9, high: 0]]
|
||||
```
|
||||
|
||||
This way, the jenkins will fail the build on 1 high issue, 10 normal issues, 100 low issues or a total issue count of 1000.
|
||||
|
||||
The `thresholds` parameter can be set for `aggregation`, `tasks`, `pmd`, `cpd`, `findbugs`, `checkstyle`, `eslint` and `pylint`.
|
||||
|
||||
```groovy
|
||||
publishCheckResults(
|
||||
tasks: true,
|
||||
pmd: [pattern: '**/target/pmd-results.xml', thresholds: [fail: [low: 100]]],
|
||||
cpd: [archive: false],
|
||||
aggregation: [thresholds: [fail: [high: 0]]],
|
||||
archive: true
|
||||
)
|
||||
```
|
||||
|
||||
![StaticChecks Thresholds](../images/StaticChecks_Threshold.png)
|
||||
|
||||
## Return value
|
||||
none
|
||||
@ -20,8 +126,7 @@ none
|
||||
none
|
||||
|
||||
## Exceptions
|
||||
* `ExceptionType`
|
||||
* List of cases when exception is thrown.
|
||||
none
|
||||
|
||||
## Example
|
||||
```groovy
|
||||
|
Loading…
Reference in New Issue
Block a user