Add a config option to suppress unmatched-source
#782
Merged
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.
Thank you for the nice project!
This is my first PR for this project.
Therefore if I have any mistakes for contribution, please let me know...
There are several reasons you might want this:
allow
list represents the set sources for a project that have gone through some external approval process, such as vetting it with a legal department.deny.toml
for all members, but not all members have identical dependency sets.deny.toml
as part of a project template, and configure it with some default set of sources you find acceptableAs it is, this warning isn't a huge deal, but is annoying/unhelpful if you don't care about it. I suspect that it's useful for catching typos or keeping configuration tight (and so I think "warn" is the right default for it), but there are enough reasons to want to turn it off that it seems justified to me for it to be an option.
It was easy to add support for a config property which controls the lint level for this check, so I just did that. I guess setting it to
deny
could be desirable in some cases, although it seems a little dodgy to me for various reasons... That said, I didn't see a reason to forbid that sort of thing, and allowing it to be configured as aLintLevel
seemed more consistent.Additional Information
warning[unmatched-source]: allowed source was not encountered
#781unused-allowed-source
is inspired bylicenses.unused-allowed-licens
in Add a config option to suppress "license was not encountered" warnings #368