ci(check-mapping): expanded license checker with more general use case #3741
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.
License checker rework
Reworked the original license checker that has been added with #3699 and also includes proposed changes in #3731.
Fixing #3714:
Added a new file
record_mapping.yaml
that acts as a schema to validate records against. In the file, it is possible to define this using yaml/json.Some specialties:
?
to the beginning of a field in the schema makes its presence in the record optionalThe following example would ensure, that the field
description
is present and of any value, only whenabstract
is also present. Ifabstract
is not present, it will not check fordescription
:Fixing #3715:
By passing arguments in the cli, it is possible to add multiple paths to folders or files to check against. This supports unix-like syntax, (i.e., wildcards, etc.) and multiple paths separated by space.
Furthermore, added a check on top of the default for only changed records, if any.
Fixing #3716:
Limited output of the checker. By passing
-v
all checked paths will be printed. Instead of printing the errors on failing, a summary card will be printed. Furthermore, this now catches different errors that occur in the same record instead of stopping after finding one.