psiroky commented on code in PR #205:
URL: https://github.com/apache/maven-enforcer/pull/205#discussion_r1058955173
##########
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:
Ah, I thought we need to use `String[]`, since it is also being used for
`commandLineRules` Just tried though and it lists are working as well, which is
definitely nicer.
I can create additional PR to get this cleaned up.
--
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]