Skip to content

Conversation

Biscgit
Copy link
Member

@Biscgit Biscgit commented May 30, 2025

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:

  • In case of the record value being a list, the sub-pattern gets applied to all elements of that list
  • Adding a ? to the beginning of a field in the schema makes its presence in the record optional
  • Values are checked against finally defined lists of strings (case-sensitive) or a single string
  • Leaving the value of a field in the mapping empty will only check if the field exists.

The following example would ensure, that the field description is present and of any value, only when abstract is also present. If abstract is not present, it will not check for description:

?abstract:
  description:

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.

@Biscgit Biscgit force-pushed the expand-license-checker branch 16 times, most recently from 78caa2a to 65bcbe4 Compare June 2, 2025 10:01
@Biscgit Biscgit marked this pull request as ready for review June 2, 2025 11:10
@Biscgit Biscgit force-pushed the expand-license-checker branch from 65bcbe4 to 6a127ae Compare June 3, 2025 08:36
@Biscgit Biscgit force-pushed the expand-license-checker branch from 6a127ae to d653588 Compare June 3, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant