Skip to content
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

Merged
merged 3 commits into from
Sep 2, 2024

Commits on Aug 30, 2024

  1. tools: Refactor SPDX check script for easier future modifications.

    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 <nikolay@zededa.com>
    OhmSpectator committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    01ab9a7 View commit details
    Browse the repository at this point in the history
  2. tools: Add support for multiple Apache-2.0 compatible SPDX license id…

    …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 <nikolay@zededa.com>
    OhmSpectator committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    8a1921d View commit details
    Browse the repository at this point in the history
  3. tools: Add support for ignoring files and directories in SPDX check.

    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 <nikolay@zededa.com>
    OhmSpectator committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    a5a13f7 View commit details
    Browse the repository at this point in the history