You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/12/27 21:21:25 UTC

[GitHub] [maven-enforcer] psiroky commented on a diff in pull request #205: [MENFORCER-431] Introduce property to skip specific rules

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


##########
maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java:
##########
@@ -134,9 +147,7 @@ public void execute() throws MojoExecutionException {
         Log log = this.getLog();
 
         PluginParameterExpressionEvaluator evaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
-        if (commandLineRules != null && commandLineRules.length > 0) {
-            this.rules = createRulesFromCommandLineOptions();
-        }
+        this.rules = determineRulesToExecute();

Review Comment:
   I am not the biggest fan of this re-assignment to the instance field, but this is the current way of doing it, so I left it for now.
   
   I could potentially just create a local variable with the updated list and leave the fields be. This could be however considered a breaking change since the `getRules()` would then be returning different list than before (updated vs original).



-- 
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-unsubscribe@maven.apache.org

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