From 6f518c8304b283de0b38759f12d52a80ddd0f53c Mon Sep 17 00:00:00 2001 From: David Schach <636977+dschach@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:28:39 -0700 Subject: [PATCH 1/2] [doc] Improve doc for --show-suppressed - it's only supported for specific formats - currently: xml, html, summaryhtml Fixes #5229 --- docs/pages/pmd/userdocs/cli_reference.md | 2 +- docs/pages/pmd/userdocs/pmd_report_formats.md | 2 +- docs/pages/release_notes.md | 2 ++ .../net/sourceforge/pmd/cli/commands/internal/PmdCommand.java | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index a499b49cf8..535a5fa945 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -159,7 +159,7 @@ The tool comes with a rather extensive help text, simply running with `--help`! description="Path to a file to which report output is written. The file is created if it does not exist. If this option is not specified, the report is rendered to standard output." %} {% include custom/cli_option_row.html options="--show-suppressed" - description="Causes the suppressed rule violations to be added to the report." + description="Causes the suppressed rule violations to be added to the report if supported by the report format. See [PMD Report formats](pmd_userdocs_report_formats.html) for details." %} {% include custom/cli_option_row.html options="--suppress-marker" option_arg="marker" diff --git a/docs/pages/pmd/userdocs/pmd_report_formats.md b/docs/pages/pmd/userdocs/pmd_report_formats.md index c0e4760e54..0b32afb05e 100644 --- a/docs/pages/pmd/userdocs/pmd_report_formats.md +++ b/docs/pages/pmd/userdocs/pmd_report_formats.md @@ -18,7 +18,7 @@ The header of the sections below are used to select the format on the command li arguments to the `--format` option. When a format accepts *properties*, those can be specified with the `--property` / `-P` option on the command-line. -{% include note.html content="Suppressed violations are only reported, if the CLI parameter `--show-suppressed` is set." %} +{% include note.html content="Suppressed violations are only reported, if the CLI parameter `--show-suppressed` is set and if the format supports showing suppressed violations. Currently only html, summaryhtml and xml show suppressed violations." %} ## sarif diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 5cde4e3dcd..26ec1d0f89 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -59,6 +59,7 @@ What changes? * [#5059](https://github.com/pmd/pmd/issues/5059): \[core] xml output doesn't escape CDATA inside its own CDATA * [#5201](https://github.com/pmd/pmd/issues/5201): \[core] PMD sarif schema file points to nonexistent location * [#5222](https://github.com/pmd/pmd/issues/5222): \[core] RuleReference/RuleSetWriter don't handle changed default property values correctly + * [#5229](https://github.com/pmd/pmd/issues/5229): \[doc] CLI flag `--show-suppressed` needs to mention xml, html, summaryhtml * java * [#5190](https://github.com/pmd/pmd/issues/5190): \[java] NPE in type inference * java-codestyle @@ -73,6 +74,7 @@ What changes? * [#5202](https://github.com/pmd/pmd/pull/5202): \[core] Sarif format: refer to schemastore.org - [David Schach](https://github.com/dschach) (@dschach) * [#5208](https://github.com/pmd/pmd/pull/5208): \[doc] Added Codety to "Tools / Integrations" - [Tony](https://github.com/random1223) (@random1223) * [#5224](https://github.com/pmd/pmd/pull/5224): \[java] Fix #5068: Class incorrectly identified as non-instantiatable - [Lukas Grรคf](https://github.com/lukasgraef) (@lukasgraef) +* [#5230](https://github.com/pmd/pmd/pull/5230): \[doc] Documentation update for --show-suppressed flag - [David Schach](https://github.com/dschach) (@dschach) {% endtocmaker %} diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java index f60632ba63..de3fe49ec3 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java @@ -138,7 +138,7 @@ public class PmdCommand extends AbstractAnalysisPmdSubcommand this.benchmark = benchmark; } - @Option(names = "--show-suppressed", description = "Report should show suppressed rule violations.") + @Option(names = "--show-suppressed", description = "Report should show suppressed rule violations if supported by the report format.") public void setShowSuppressed(final boolean showSuppressed) { this.showSuppressed = showSuppressed; } From 03fba2443a071279ede3da764e95e7138b8f9508 Mon Sep 17 00:00:00 2001 From: David Schach <636977+dschach@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:32:54 -0700 Subject: [PATCH 2/2] [doc] Update @dschach as a contributor --- .all-contributorsrc | 3 ++- docs/pages/pmd/projectdocs/credits.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 07507c2070..c83958d2ac 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7753,7 +7753,8 @@ "profile": "https://github.com/dschach", "contributions": [ "bug", - "code" + "code", + "doc" ] }, { diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 3a787ab38d..b452f33c01 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -226,7 +226,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d David M. Karr (fullname at gmail.com)
David M. Karr (fullname at gmail.com)

๐Ÿ› David Renz
David Renz

๐Ÿ’ป ๐Ÿ› David Renz
David Renz

๐Ÿ› - David Schach
David Schach

๐Ÿ› ๐Ÿ’ป + David Schach
David Schach

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– Dawid Ciok
Dawid Ciok

๐Ÿ› ๐Ÿ’ป Debamoy Datta
Debamoy Datta

๐Ÿ’ป