You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by eo...@apache.org on 2020/02/06 11:09:49 UTC

[maven-checkstyle-plugin] branch MCHECKSTYLE-389 updated (64db127 -> 4ed1a5d)

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a change to branch MCHECKSTYLE-389
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git.


    omit 64db127  [MCHECKSTYLE-389] Partial revert of MCHECKSTYLE-365 severity change back to 'null' default
     add e1e2f28  MCHECKSTYLE-384 Bump checkstyle to 8.28
     new 4ed1a5d  [MCHECKSTYLE-389] Partial revert of MCHECKSTYLE-365 severity change back to 'null' default

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (64db127)
            \
             N -- N -- N   refs/heads/MCHECKSTYLE-389 (4ed1a5d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                                |  2 +-
 src/it/MCHECKSTYLE-129/pom.xml                         |  2 +-
 src/it/MCHECKSTYLE-357/pom.xml                         | 13 ++++++-------
 src/it/MCHECKSTYLE-70-multi-sourcefolder/verify.groovy |  4 ++--
 src/it/multi-modules-aggregate/maven_checks.xml        | 12 ++++++------
 5 files changed, 16 insertions(+), 17 deletions(-)


[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-389] Partial revert of MCHECKSTYLE-365 severity change back to 'null' default

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch MCHECKSTYLE-389
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit 4ed1a5dfa16c2ba0b599528b033b841f539c41ac
Author: Jeremy Landis <je...@hotmail.com>
AuthorDate: Mon Jan 20 19:35:03 2020 -0500

    [MCHECKSTYLE-389] Partial revert of MCHECKSTYLE-365 severity change back to 'null' default
    
    The severity setting even on original logic is incorrect.  It must remain null if it is to work properly at all.  While counts in fact are off, the entire section will be lost if it doesn't contain issues in at least 'error' due to the change when using default configurations.  This has to be reverted as not originally fixed properly so that the rules aggregate will display.  Example case has no 'error' type, only 'warning'.  Changing this to 'warning' will pick that section up.  Usin [...]
---
 src/it/MCHECKSTYLE-365/verify.groovy                              | 8 ++++++--
 .../maven/plugins/checkstyle/CheckstyleReportGenerator.java       | 7 ++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/it/MCHECKSTYLE-365/verify.groovy b/src/it/MCHECKSTYLE-365/verify.groovy
index 82810c2..4e0b594 100644
--- a/src/it/MCHECKSTYLE-365/verify.groovy
+++ b/src/it/MCHECKSTYLE-365/verify.groovy
@@ -32,14 +32,18 @@ assert htmlReportFile.exists();
  *
  * A more robust solution would be to parse the HTML, but that's
  * a lot more effort than required to actually verify the behaviour.
+ *
+ * TODO: The original fix of MCHECKSTYLE-365 does not take into account when 'error'
+ * type doesn't exist and therefore breaks 'rules' aggregate reporting. As a result, counts
+ * set back to 3 and code is reverted. A better fix needs to be implemented.
  */
 
 // Case with no custom messages
 def numberOfOccurancesOfFileTabCharacter = htmlReportFile.text.count(">FileTabCharacter<")
-assert 2 == numberOfOccurancesOfFileTabCharacter;
+assert 3 == numberOfOccurancesOfFileTabCharacter;
 
 // Case with custom messages
 def numberOfOccurancesOfRegexpSingleline = htmlReportFile.text.count(">RegexpSingleline<");
-assert 2 == numberOfOccurancesOfRegexpSingleline;
+assert 3 == numberOfOccurancesOfRegexpSingleline;
 
 return true;
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
index a443998..aae277d 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
@@ -807,9 +807,10 @@ public class CheckstyleReportGenerator
             else
             {
                 String fixedmessage = getConfigAttribute( childConfig, null, "message", null );
-                // Grab the severity from the rule configuration, use "error" as default value (as is 
-                // done where the rule severity is displayed otherwise we miscount error violations)
-                String configSeverity = getConfigAttribute( childConfig, null, "severity", "error" );
+                // Grab the severity from the rule configuration. Do not set default value here as
+                // it breaks our rule aggregate section entirely.  The counts are off but this is
+                // not appropriate fix location per MCHECKSTYLE-365.
+                String configSeverity = getConfigAttribute( childConfig, null, "severity", null );
 
                 // count rule violations
                 long violations = 0;