This repository provides a pre-commit hook for validating and analyzing SPDX license headers in your codebase using the spdx-checker Python package.
- Fast SPDX license header validation for source files
- Integrates seamlessly with pre-commit
- Helps ensure license compliance across your project
-
Install pre-commit (if not already):
pip install pre-commit
-
Add the hook to your
.pre-commit-config.yaml:- repo: https://github.com/to-sta/spdx-checker-pre-commit rev: v0.1.1 # Add the most recent version here hooks: - id: spdx-license-checker name: spdx-license-checker args: [-l, AGPL-3.0-or-later, --fix, --continue-on-error] types_or: [python, ts, javascript, vue, css, html]
-
Install the hook:
pre-commit install
- Python >=3.11 for Linux and MacOS (ARM only)
- Python >=3.11 for Windows
spdx-checker