-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance SPDX check script with ignoring mechanism and improved flexibility #4190
Enhance SPDX check script with ignoring mechanism and improved flexibility #4190
Conversation
323b48f
to
848bf5d
Compare
Extracted file type check logic into a separate function `file_to_be_checked`. Extracted SPDX check logic into a separate function `check_spdx`. Make the check case insesitive. Simplified the main loop to use the new functions for better readability and maintainability. Signed-off-by: Nikolay Martyanov <[email protected]>
…entifiers. Updated `spdx-check.sh` to support multiple SPDX license identifiers. This change allows the script to check for various Apache-2.0 compatible licenses, ensuring compliance with a broader range of open-source licenses. Signed-off-by: Nikolay Martyanov <[email protected]>
Introduce `.spdxignore` file to list paths to be ignored during SPDX check. Add all `vendor` directories there. Update `spdx-check.sh` script to read `.spdxignore`. Modified `file_to_be_checked` function to skip files and directories listed in `.spdxignore`. Signed-off-by: Nikolay Martyanov <[email protected]>
848bf5d
to
a5a13f7
Compare
Does the script already ignore everything in the vendor directories? |
Would it make sense to check for a Copyright line in the same files? (We can separately discuss whether the Copyright should include the current year - that should be done if there are significant changes but it is a bit painful for minor changes such as changing an import path in lots of files.) |
It does, but I changed how we set up the ignored directories. Now, it works in an extensible way. |
It's a good idea. We can add this check, but I would prefer to do it in a separate PR as it requires some extra logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request focuses on enhancing the
spdx-check.sh
script by introducing an ignoring mechanism. This new feature allows the script to skip specific files or patterns, providing more control over which files are subjected to SPDX license checks. Additionally, the script has been refactored to improve maintainability and support for multiple Apache-2.0 compatible SPDX license identifiers.