adangel commented on code in PR #745:
URL: https://github.com/apache/maven-pmd-plugin/pull/745#discussion_r4154852925


##########
src/main/java/org/apache/maven/plugins/pmd/AbstractPmdViolationCheckMojo.java:
##########
@@ -65,13 +66,15 @@ public abstract class AbstractPmdViolationCheckMojo<D> 
extends AbstractMojo {
     protected boolean aggregate;
 
     /**
-     * Print details of check failures to build output.
+     * Print details of all violations to build output. When enabled, this 
takes
+     * precedence over {@code printFailingErrors}.
      */
     @Parameter(property = "pmd.verbose", defaultValue = "false")
     private boolean verbose;
 
     /**
-     * Print details of errors that cause build failure.
+     * Print details of errors that cause build failure when {@code verbose} is
+     * disabled. This option is ignored when {@code verbose} is enabled.

Review Comment:
   ```suggestion
        * disabled. This option is ignored when {@code verbose} is enabled.
        * For PMD, use {@code failurePriority} to configure which priority 
level counts as a failure.
   ```



##########
src/main/java/org/apache/maven/plugins/pmd/AbstractPmdViolationCheckMojo.java:
##########
@@ -65,13 +66,15 @@ public abstract class AbstractPmdViolationCheckMojo<D> 
extends AbstractMojo {
     protected boolean aggregate;
 
     /**
-     * Print details of check failures to build output.
+     * Print details of all violations to build output. When enabled, this 
takes
+     * precedence over {@code printFailingErrors}.

Review Comment:
   ```suggestion
        * Print details of all violations (warnings and failures) to the build 
output.
        * When enabled, this takes precedence over {@code printFailingErrors}.
        * For PMD, use {@code failurePriority} to configure which priority 
level counts as a failure.
   ```
   
   On first glance, I was not sure, what the difference between verbose and 
printFailing errors are...



##########
src/test/java/org/apache/maven/plugins/pmd/AbstractPmdViolationCheckMojoTest.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugins.pmd;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class AbstractPmdViolationCheckMojoTest {

Review Comment:
   Please have a look at the test classes 
org.apache.maven.plugins.pmd.PmdViolationCheckMojoOnLinuxTest and 
org.apache.maven.plugins.pmd.CpdViolationCheckMojoTest. I think, the test 
belongs there. Then we also don't need to use reflection to set fields.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to