checkstyle / checkstyle/regression-tool
Report: using GroovyShell instead of running CLI directly
- Dominant language
- Java
- Stars
- 9
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
Taken from https://github.com/checkstyle/regression-tool/pull/48#discussion_r128231026
We are now using CLI way to invoke `diff.groovy` and it is better to do this by a Groovy invoker library, like `GroovyShell`.
An example of `GroovyShell`: https://github.com/Luolc/regression-tool/blob/dd02aa9019a7c02bafb028dcf7ec85e635256aa2/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java#L49.
More information about invoking Groovy script: http://groovy-lang.org/integrating.html
The reason we don't use `GroovyShell` now is stated at https://github.com/checkstyle/regression-tool/pull/48#issuecomment-315335160:
> I am impossible to change the working directory of the invoker. There are many relative path used in the script, and we would have problems when invoking it outside its parent folder. Even in CLI, we are not able to run it outside.
Example of relative path in `diff.groovy`: https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/diff.groovy#L183
The way to get the path of the script: https://stackoverflow.com/questions/1163093/how-do-you-get-the-path-of-the-running-script-in-groovy?answertab=votes#tab-top
We need to update `diff.groovy` if we want to use `GroovyShell` way.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.