diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index cf90f0e39b..a499b49cf8 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -5,7 +5,7 @@ tags: [userdocs] keywords: [command, line, options, help, formats, renderers] permalink: pmd_userdocs_cli_reference.html author: Tom Copeland , Xavier Le Vourch , Juan Martín Sotuyo Dodero -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- @@ -210,7 +210,7 @@ Or you can set the environment variable `CLASSPATH` before starting PMD, e.g. ## Exit Status -Please note that if PMD detects any violations, it will exit with status 4 (since 5.3) or 5 (since 7.2.0). +Please note that if PMD detects any violations, it will exit with status 4 (since 5.3) or 5 (since 7.3.0). This behavior has been introduced to ease PMD integration into scripts or hooks, such as SVN hooks. @@ -219,7 +219,7 @@ This behavior has been introduced to ease PMD integration into scripts or hooks, + To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.3.0.

2Usage error. Command-line parameters are invalid or missing.
4At least one violation has been detected, unless --no-fail-on-violation is set.

Since PMD 5.3.

5At least one recoverable error has occurred. There might be additionally zero or more violations detected. - To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.2.0.

{%include note.html content="If PMD exits with 5, then PMD had either trouble parsing one or more files or a rule failed with an exception. diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index 0be9c12cac..1bf2954c18 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -4,7 +4,7 @@ tags: [cpd, userdocs] summary: "Learn how to use CPD, the copy-paste detector shipped with PMD." permalink: pmd_userdocs_cpd.html author: Tom Copeland -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- ## Overview @@ -284,7 +284,7 @@ If you specify a source directory but don't want to scan the sub-directories, yo ### Exit status -Please note that if CPD detects duplicated source code, it will exit with status 4 (since 5.0) or 5 (since 7.2.0). +Please note that if CPD detects duplicated source code, it will exit with status 4 (since 5.0) or 5 (since 7.3.0). This behavior has been introduced to ease CPD integration into scripts or hooks, such as SVN hooks. @@ -293,7 +293,7 @@ This behavior has been introduced to ease CPD integration into scripts or hooks, + To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.3.0.

2Usage error. Command-line parameters are invalid or missing.
4At least one code duplication has been detected unless --no-fail-on-violation is set.

Since PMD 5.0.

5At least one recoverable error has occurred. There might be additionally zero or more duplications detected. - To ignore recoverable errors, use --no-fail-on-error.

Since PMD 7.2.0.

{%include note.html content="If PMD exits with 5, then PMD had trouble lexing one or more files. @@ -402,7 +402,7 @@ Andy Glover wrote an Ant task for CPD; here's how to use it: If not specified, CPD uses the system default encoding." %} {% include custom/cli_option_row.html options="failOnError" - description="Whether to fail the build if any errors occurred while processing the files. Since PMD 7.2.0." + description="Whether to fail the build if any errors occurred while processing the files. Since PMD 7.3.0." default="true" %} {% include custom/cli_option_row.html options="format" @@ -441,7 +441,7 @@ Andy Glover wrote an Ant task for CPD; here's how to use it: {% include custom/cli_option_row.html options="skipLexicalErrors" description="Deprecated Skip files which can't be tokenized due to invalid characters instead of aborting CPD. This parameter is deprecated and - ignored since PMD 7.2.0. It is now by default true. Use `failOnError` instead to fail the build." + ignored since PMD 7.3.0. It is now by default true. Use `failOnError` instead to fail the build." default="true" %} {% include custom/cli_option_row.html options="skipBlocks" diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index f81e1aa546..b37ea8ad5f 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -6,7 +6,7 @@ author: > David Dixon-Peugh , Tom Copeland , Xavier Le Vourch -last_updated: May 2024 (7.2.0) +last_updated: June 2024 (7.3.0) --- ## PMD diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java index b82671c22f..e27ca93821 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/CPDTask.java @@ -103,7 +103,7 @@ public class CPDTask extends Task { config.setSkipDuplicates(skipDuplicateFiles); if (skipLexicalErrors) { - log("skipLexicalErrors is deprecated since 7.2.0 and the property is ignored. " + log("skipLexicalErrors is deprecated since 7.3.0 and the property is ignored. " + "Lexical errors are now skipped by default and the build is failed. " + "Use failOnError=\"false\" to not fail the build.", Project.MSG_WARN); } @@ -277,7 +277,7 @@ public class CPDTask extends Task { /** * Whether to fail the build if any recoverable errors occurred while processing the files. * - * @since 7.2.0 + * @since 7.3.0 */ public void setFailOnError(boolean failOnError) { this.failOnError = failOnError; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java index 567917a98f..0960a0fd48 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractConfiguration.java @@ -416,13 +416,13 @@ public abstract class AbstractConfiguration { * Whether PMD should exit with status 5 (the default behavior, true) if * recoverable errors occurred or just with 0 (to not break the build, e.g.). * - *

Note: If only violations are found, the exist status is 4. See + *

Note: If only violations are found, the exit status is 4. See * {@link #isFailOnViolation()}. * * @return failOnError * * @see #isFailOnViolation() - * @since 7.2.0 + * @since 7.3.0 */ public boolean isFailOnError() { return failOnError; @@ -432,13 +432,13 @@ public abstract class AbstractConfiguration { * Sets whether PMD should exit with status 5 (the default behavior, true) * if recoverable errors occurred or just with 0 (to not break the build, e.g.). * - *

Note: If only violations are found, the exist status is 4. See + *

Note: If only violations are found, the exit status is 4. See * {@link #isFailOnViolation()}. * * @param failOnError whether to exit with 5 and fail the build if recoverable errors occurred. * * @see #isFailOnViolation() - * @since 7.2.0 + * @since 7.3.0 */ public void setFailOnError(boolean failOnError) { this.failOnError = failOnError;