-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need a possibility for Check failures to return exit code 0 with findings #227
Comments
@JJN2 if |
In this case lein-kibit check prints out few findings from Clojure scripts and exits with value 1. Problem is that non-zero exit values are interpreted in Maven as a plugin failure (plugin fails to execute normally and exits with non-zero error code) and causes build errors. |
What is the purpose of running kibit via Maven? Do you want a non-zero exit code somewhere in the chain further up? How do you signal to Maven that Kibit didn't return successfully, without making it look like the plugin itself has failed to execute? |
Clojure scripts are just one part of a larger system in where Maven is used as a build tool. Maven is used also to run static analysis for all source code in the system. Additional build tools or applications are not wanted there since they would contaminate building process with their own requirements and needs. That is the base reason why everything (when possible) is done via Maven. The only plugin I found which runs Leiningen as a stand-alone library in Maven is lein-maven-plugin: (https://github.com/ingesolvoll/lein-maven-plugin), it returns any exit value lein plugin might return and there is no possibility to ignore it (which are interpreted as plugin execution failures in Maven). Do you think this is rather a lein-maven-plugin (https://github.com/ingesolvoll/lein-maven-plugin) issue or could there be a configuration (someday) in lein-kibit where user is allowed to alter exit value (even value 0) for lein-kibit in cases where it finds suggestions? ... or is there a better work around to handle this? |
The default behaviour (for application) is to consider the exit code 0 as successful execution and all the others as failure. In our case we use Maven and run Leiningen as a library with lein-maven-plugin (ingesolvoll).
Even though lein-kibit run is successful it returns exit code 1 to Maven plugin which is interpreted as plugin failure. This forces us to use -fn (never fail) flag in Maven, since it causes build errors. Tried other workarounds too with no success (eg. running with forced exit 0... kibit || true)
Could it be possible eg. to add a switch to kibit which would allow Check failures to exit with code 0 and show all failures in Clojure scripts ?
It would be nice to have failure output as xml / html files if needed, Jenkins plugin showing failures would be useful too.
This is the only plugin I could find for Clojure script static analysis. Awesome plugin. Keep up the good work :)
The text was updated successfully, but these errors were encountered: