From a179dc6e3d2154598fd1d9997f77d6df065c896d Mon Sep 17 00:00:00 2001 From: Alejandra Ferreiro Vidal Date: Thu, 28 Mar 2019 13:27:41 +0100 Subject: [PATCH] checksPublishResults: generate docu --- .../docs/steps/checksPublishResults.md | 46 ++---------------- vars/checksPublishResults.groovy | 47 +++++++++++++++++-- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/documentation/docs/steps/checksPublishResults.md b/documentation/docs/steps/checksPublishResults.md index 032da43af..fc5fa9ba1 100644 --- a/documentation/docs/steps/checksPublishResults.md +++ b/documentation/docs/steps/checksPublishResults.md @@ -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 diff --git a/vars/checksPublishResults.groovy b/vars/checksPublishResults.groovy index 4495cbb1c..7c09c42bf 100644 --- a/vars/checksPublishResults.groovy +++ b/vars/checksPublishResults.groovy @@ -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) {