Workiva / dependency_validator

A tool to help you find missing, under-promoted, over-promoted, and unused dependencies.
Other
56 stars 18 forks source link

CI/CD #76

Closed pinkasey closed 2 years ago

pinkasey commented 2 years ago

It would like to be able to use this plugin as part of CI/CD. mainly - if it detects an unused package, it should fail the build. Right now I see that it only prints to the cli.

So if you could add a flag like --fail-on-unused-package or something, and this flag would cause the execution to terminate with an error code - that would be enough for us to use this in CI/CD - simply run flutter pub run dependency_validator --fail-on-unused-package, and if it fails - the build fails.

WDYT?

pinkasey commented 2 years ago

how embarrasing - I see that it does return exit code 1.

Can you tell in which cases? Maybe write it in the README.md?

evanweible-wf commented 2 years ago

Hey @pinkasey, sorry for the delay in responding. It should return a non-zero exit code for any of the following findings:

(The only exceptions to this are for packages that provide executables or auto-applied builders, since we assume those to be used for convenience. The tool should make a note of those things, though.)

We do list those things in the readme, but it isn't explicitly stated that all of these should result in an non-zero exit code. I agree that would be a good note to add!

Also FYI we just released a bug fix (#78) because we were previously returning a zero exit code if the deprecated command-line arguments from v2 were used. That should now properly return a non-zero exit code, too.

pinkasey commented 2 years ago

Awesome Thanks