[#78] improvement: refactor license check to use whitelist-based config#79
Merged
Conversation
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>
jerryshao
reviewed
Mar 16, 2026
|
|
||
| exclude_patterns = [ | ||
| "examples/localfs/**", | ||
| ] |
Contributor
There was a problem hiding this comment.
I have the same comment left in the python-sdk repo.
jerryshao
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #78
Replaces the hardcoded file list in
scripts/check-license.pywith a.license-check.tomlconfiguration 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
.license-check.toml: definesinclude_patternsandexclude_patternsusing pathlib glob syntaxscripts/check-license.py: now reads config file, discovers files via glob, and checks for the copyright markerTesting
python3.11 scripts/check-license.py— all 105 files pass (same count as original)python scripts/check-license.py)