Skip to content

Support glob patterns in referenced license files - #5296

Open
SidheshwarSarangal wants to merge 1 commit into
aboutcode-org:developfrom
SidheshwarSarangal:fix-4276-referenced-filename-globs
Open

Support glob patterns in referenced license files#5296
SidheshwarSarangal wants to merge 1 commit into
aboutcode-org:developfrom
SidheshwarSarangal:fix-4276-referenced-filename-globs

Conversation

@SidheshwarSarangal

Copy link
Copy Markdown

Fixes #4276

This adds support for glob patterns in license rule
referenced_filenames, including directory patterns such as
licenses/*.

The change:

  • preserves the existing fast path for exact filenames;
  • matches glob patterns one path segment at a time, preventing wildcards
    from crossing directory boundaries;
  • resolves matches through the existing resource-location rules;
  • aggregates all matching referenced license files while avoiding
    duplicates;
  • adds a regression test for a directory glob resolving multiple files.

Tests:

  • tests/licensedcode/test_plugin_license_detection.py: 21 passed
  • tests/packagedcode/test_license_detection.py: 19 passed

Signed-off-by: Sidheshwar Sarangal <sidheshwar.sarangal@gmail.com>
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.

Support directories in referenced_filenames for rules

1 participant