maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject svn commit: r1609305 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
Date Wed, 09 Jul 2014 21:18:12 GMT
Author: michaelo
Date: Wed Jul  9 21:18:12 2014
New Revision: 1609305

URL: http://svn.apache.org/r1609305
Log:
[MCHECKSTYLE-217] Add parameter which skips rule rows which do not have any violations

Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=1609305&r1=1609304&r2=1609305&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
(original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
Wed Jul  9 21:18:12 2014
@@ -348,6 +348,17 @@ public class CheckstyleReportGenerator
     private void doRuleRow( Configuration checkerConfig, List<Configuration> parentConfigurations,
String ruleName,
                             CheckstyleResults results )
     {
+        String fixedmessage = getConfigAttribute( checkerConfig, null, "message", null );
+        // Grab the severity from the rule configuration, use null as default value
+        String configSeverity = getConfigAttribute( checkerConfig, null, "severity", null
);
+        long violations = countRuleViolation( results.getFiles().values(), ruleName, fixedmessage,
configSeverity );
+
+        if ( violations == 0 )
+        {
+            // skip rules without violations
+            return;
+        }
+
         sink.tableRow();
 
         // column 1: severity
@@ -430,16 +441,7 @@ public class CheckstyleReportGenerator
 
         // column 3: rule violation count
         sink.tableCell();
-        String fixedmessage = getConfigAttribute( checkerConfig, null, "message", null );
-        // Grab the severity from the rule configuration, use null as default value
-        String configSeverity = getConfigAttribute( checkerConfig, null, "severity", null
);
-        long violations = countRuleViolation( results.getFiles().values(), ruleName, fixedmessage,
configSeverity );
         sink.text( String.valueOf( violations ) );
-        if ( violations > 0 )
-        {
-            sink.nonBreakingSpace();
-            iconTool.iconSeverity( severity );
-        }
         sink.tableCell_();
 
         sink.tableRow_();



Mime
View raw message