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 2021/01/23 08:56:10 UTC
[GitHub] [maven-checkstyle-plugin] bmarwell commented on a change in pull request #36: [MCHECKSTYLE-397] support ${config_loc} on checkstyle xml
bmarwell commented on a change in pull request #36:
URL: https://github.com/apache/maven-checkstyle-plugin/pull/36#discussion_r563040248
##########
File path: src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
##########
@@ -584,6 +584,20 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request )
}
}
+ //${config_loc} for the origin dir of the configLocation, just like eclipsecs
+ // so we config such as `${config_loc}/checkstyle-suppressions.xml`
+ final String configLocation = request.getConfigLocation();
+ final int idx = configLocation.lastIndexOf( '/' );
+ final String configLoc;
+ if ( idx == -1 )
+ {
+ configLoc = "";
+ }
+ else
+ {
+ configLoc = configLocation.substring( 0, idx );
+ }
+ p.setProperty( "config_loc", configLoc );
Review comment:
Why set `config_loc` anyway if `idx == -1`?
##########
File path: src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
##########
@@ -584,6 +584,20 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request )
}
}
+ //${config_loc} for the origin dir of the configLocation, just like eclipsecs
+ // so we config such as `${config_loc}/checkstyle-suppressions.xml`
+ final String configLocation = request.getConfigLocation();
+ final int idx = configLocation.lastIndexOf( '/' );
+ final String configLoc;
+ if ( idx == -1 )
+ {
+ configLoc = "";
+ }
+ else
+ {
+ configLoc = configLocation.substring( 0, idx );
+ }
+ p.setProperty( "config_loc", configLoc );
Review comment:
Please add a test case.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org