1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-05 15:15:44 +02:00

Merge pull request #606 from alejandraferreirovidal/checksPublishResults

checksPublishResults: generate docu
This commit is contained in:
Alejandra Ferreiro Vidal 2019-04-09 20:42:44 +02:00 committed by GitHub
commit 81e22b9cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 46 deletions

View File

@ -1,8 +1,6 @@
# checksPublishResults
# ${docGenStepName}
## Description
This step can publish static check results from various sources.
## ${docGenDescription}
## Prerequisites
@ -15,31 +13,7 @@ This step can publish static check results from various sources.
* [warnings](https://plugins.jenkins.io/warnings)
* [core](https://plugins.jenkins.io/core)
## Parameters
| parameter | mandatory | default | possible values |
| ---------------|-----------|-----------------------------------|--------------------|
| script | yes | | |
| 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` |
* `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.
## ${docGenParameters}
### aggregation
@ -106,19 +80,7 @@ Each of the parameters `aggregation`, `tasks`, `pmd`, `cpd`, `findbugs`, `checks
| archive | no | `true` | `true`, `false` |
| thresholds | no | none | see [thresholds](#thresholds) |
## Step configuration
Following parameters can also be specified as step parameters using the global configuration file:
* `aggregation`
* `tasks`
* `pmd`
* `cpd`
* `findbugs`
* `checkstyle`
* `eslint`
* `pylint`
* `archive`
## ${docGenConfiguration}
### Thresholds

View File

@ -2,6 +2,7 @@ import static com.sap.piper.Prerequisites.checkScript
import com.cloudbees.groovy.cps.NonCPS
import com.sap.piper.GenerateDocumentation
import com.sap.piper.ConfigurationHelper
import com.sap.piper.MapUtils
import com.sap.piper.Utils
@ -11,7 +12,46 @@ import groovy.transform.Field
@Field def STEP_NAME = getClass().getName()
@Field Set TOOLS = [
'aggregation', 'tasks', 'pmd', 'cpd', 'findbugs', 'checkstyle', 'eslint', 'pylint'
/**
* Allows to publish the check results.
* @possibleValues `true`, `false`, `Map`
*/
'aggregation',
/**
* Searches and publishes TODOs in files with the [Task Scanner Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Task+Scanner+Plugin).
* @possibleValues `true`, `false`, `Map`
*/
'tasks',
/**
* Publishes PMD findings with the [PMD plugin](https://plugins.jenkins.io/pmd).
* @possibleValues `true`, `false`, `Map`
*/
'pmd',
/**
* Publishes CPD findings with the [DRY plugin](https://plugins.jenkins.io/dry).
* @possibleValues `true`, `false`, `Map`
*/
'cpd',
/**
* Publishes Findbugs findings with the [Findbugs plugin](https://plugins.jenkins.io/findbugs).
* @possibleValues `true`, `false`, `Map`
*/
'findbugs',
/**
* Publishes Checkstyle findings with the [Checkstyle plugin](https://plugins.jenkins.io/checkstyle).
* @possibleValues `true`, `false`, `Map`
*/
'checkstyle',
/**
* Publishes ESLint findings (in [JSLint format](https://eslint.org/docs/user-guide/formatters/)) with the [Warnings plugin](https://plugins.jenkins.io/warnings).
* @possibleValues `true`, `false`, `Map`
*/
'eslint',
/**
* Publishes PyLint findings with the [Warnings plugin](https://plugins.jenkins.io/warnings), pylint needs to run with `--output-format=parseable` option.
* @possibleValues `true`, `false`, `Map`
*/
'pylint'
]
@Field Set GENERAL_CONFIG_KEYS = []
@ -19,10 +59,9 @@ import groovy.transform.Field
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
/**
* checksPublishResults
*
* @param others document all parameters
* This step can publish static check results from various sources.
*/
@GenerateDocumentation
void call(Map parameters = [:]) {
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {