Add option to fail if a crate's license cannot be reasonably discovered #213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi y'all, thanks for creating this awesome project :)
As part of integrating this into our CI builds we wanted an option to fail CI if a crate's license could not be determined. I initially set out to implement #203 but quickly discovered that there are a lot of warnings generated for problems that get fixed in a later pass (e.g. failing to read a license identifier but successfully synthesizing one). I tried to put my check as late in the process as possible so that this flag only generates errors in truly unrecoverable situations. As such I think this PR captures the spirit of #203, if not the wording.
For testing I temporarily added this line as a dependency to cargo about:
For whatever reason, this dependency's license cannot be detected by
cargo about
, probably because we're depending on a module in this non-library project rather than going through crates.io. Regardless, runningcargo run generate --fail_on_missing_license about.hbs
should now generate an error like so:Adding the following field to
about.toml
should fix said error:Let me know if there's anything I can fix or reformat :)
Checklist
Description of Changes
Adds a
fail_on_missing_license
flag to the CLI.Related Issues
#203