slawekjaranowski commented on code in PR #205:
URL: https://github.com/apache/maven-enforcer/pull/205#discussion_r1058959931


##########
maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java:
##########
@@ -282,6 +288,22 @@ private Optional<PlexusConfiguration> 
createRulesFromCommandLineOptions() {
         return Optional.of(configuration);
     }
 
+    /**
+     * Filter our (remove) rules that have been specifically skipped via 
additional configuration.
+     *
+     * @param allRules list of enforcer rules to go through and filter
+     *
+     * @return list of filtered rules
+     */
+    private List<EnforcerRuleDesc> 
filterOutSkippedRules(List<EnforcerRuleDesc> allRules) {
+        if (rulesToSkip == null || rulesToSkip.length == 0) {
+            return allRules;
+        }
+        return allRules.stream()
+                .filter(ruleDesc -> !ArrayUtils.contains(rulesToSkip, 
ruleDesc.getName()))

Review Comment:
   
https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Mapping_Collections_and_Arrays



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to