Skip to content

[#78] improvement: refactor license check to use whitelist-based config#79

Merged
jerryshao merged 4 commits into
mainfrom
improvement/license-check-whitelist
Mar 16, 2026
Merged

[#78] improvement: refactor license check to use whitelist-based config#79
jerryshao merged 4 commits into
mainfrom
improvement/license-check-whitelist

Conversation

@mchades

@mchades mchades commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #78

Replaces the hardcoded file list in scripts/check-license.py with a .license-check.toml configuration file using glob patterns. This follows the same philosophy as Gradle's RAT plugin — define which files should have license headers via a whitelist config, rather than embedding the logic in the script.

Changes

  • Added .license-check.toml: defines include_patterns and exclude_patterns using pathlib glob syntax
  • Rewrote scripts/check-license.py: now reads config file, discovers files via glob, and checks for the copyright marker

Testing

  • Ran python3.11 scripts/check-license.py — all 105 files pass (same count as original)
  • CI workflow file unchanged (still calls python scripts/check-license.py)

Replace hardcoded file list in check-license.py with a .license-check.toml
configuration file. Include patterns use Python pathlib glob syntax, making it
easy to add new file types or directories without modifying the script.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread .license-check.toml

exclude_patterns = [
"examples/localfs/**",
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same comment left in the python-sdk repo.

@mchades
mchades requested a review from jerryshao March 16, 2026 09:55
@jerryshao
jerryshao merged commit 461e5ec into main Mar 16, 2026
6 checks passed
@jerryshao
jerryshao deleted the improvement/license-check-whitelist branch March 16, 2026 10:07
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.

Refactor license header check to use whitelist-based configuration

2 participants