diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index f0ff70714e..0068c0480d 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -37,6 +37,7 @@ The old rule names still work but are deprecated. ### ✨ Merged pull requests * [#4965](https://github.com/pmd/pmd/pull/4965): \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) +* [#5241](https://github.com/pmd/pmd/pull/5241): \Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) {% endtocmaker %} diff --git a/javacc-wrapper.xml b/javacc-wrapper.xml index 2c43e086d8..05837e96ba 100644 --- a/javacc-wrapper.xml +++ b/javacc-wrapper.xml @@ -224,6 +224,9 @@ + + + @@ -262,7 +265,8 @@ - + @@ -272,7 +276,8 @@ - + @@ -385,11 +390,12 @@ - +'/> @@ -534,8 +540,9 @@ public final class ${token-constants-name} \{${line.separator} - + diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java b/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java new file mode 100644 index 0000000000..ab9b46f465 --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/annotation/Generated.java @@ -0,0 +1,23 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Marks a class as generated code, and therefore to be ignored for code coverage purposes. + * + * @since 7.6.0 + */ +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface Generated { + + /** The generator that produced this code */ + String value() default ""; + +} diff --git a/pom.xml b/pom.xml index 9135446886..8f0474ab59 100644 --- a/pom.xml +++ b/pom.xml @@ -611,7 +611,7 @@ org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.12 org.cyclonedx