janhoy opened a new issue, #7: URL: https://github.com/apache/solr-orbit/issues/7
## Summary There is currently no automated enforcement of the ASF SPDX license header on source files. Add the [pre-commit](https://pre-commit.com/) framework with the [`insert-license`](https://github.com/Lucas-C/pre-commit-hooks) hook so that every commit automatically checks (and optionally inserts) the required header. ## Motivation - Apache Airflow uses this exact setup to enforce license headers across `.py`, `.sh`, `.yaml`, `.xml`, `.md` and more via per-type templates in `scripts/ci/license-templates/` - Catches missing headers at commit time rather than at release time (when Apache RAT runs) - ASF policy requires every source file to carry the SPDX Apache-2.0 header ## Proposed changes 1. Add `.pre-commit-config.yaml` with `Lucas-C/pre-commit-hooks` `insert-license` hook 2. Add license header templates under `scripts/ci/license-templates/` (one per file type) 3. Configure hooks for `.py`, `.sh`, `.yaml`/`.yml`, `.toml`, `.cfg`, `.md` 4. Add `pre-commit` to dev dependencies (or document `pip install pre-commit && pre-commit install`) 5. Add a `make pre-commit` target and run in CI ## References - https://pre-commit.com/ - https://github.com/Lucas-C/pre-commit-hooks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
