Skip to content

Comments

Add automated SPDX license header fixer and CI workflow#116

Open
abdelkadermeflahi6-web wants to merge 1 commit intomainfrom
codex/check-and-fix-license-headers
Open

Add automated SPDX license header fixer and CI workflow#116
abdelkadermeflahi6-web wants to merge 1 commit intomainfrom
codex/check-and-fix-license-headers

Conversation

@abdelkadermeflahi6-web
Copy link
Owner

Motivation

  • Ensure repository files include a consistent SPDX license header and automate adding any missing headers.
  • Provide a CI workflow to run the header fixer on pushes to main and on pull requests so fixes can be proposed automatically.

Description

  • Add fix_license_headers.py, a CLI script that scans a target path and inserts a configurable SPDX-License-Identifier: MIT header for supported file types.
  • The fixer supports multiple comment styles (e.g. .py, .js, .ts, .sol, .aiken, .hs, .yaml) and skips common vendor/build directories such as .git, node_modules, dist, and __pycache__.
  • The script preserves shebang lines when present and ensures a blank line separates the header from the file body when appropriate.
  • Add a GitHub Actions workflow .github/workflows/check-fix-license-headers.yml that runs the fixer in CI and opens an automated pull request with the changes using peter-evans/create-pull-request.

Testing

  • Ran python fix_license_headers.py --help to verify the CLI usage output and it succeeded.
  • Executed a functional test by creating a temporary sample.py, running python fix_license_headers.py <tmpdir>, and verifying the SPDX-License-Identifier: MIT header was inserted; the test succeeded.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant