Skip to content

to-sta/spdx-checker-pre-commit

Repository files navigation

SPDX License Checker Pre-commit Hook

This repository provides a pre-commit hook for validating and analyzing SPDX license headers in your codebase using the spdx-checker Python package.

Features

  • Fast SPDX license header validation for source files
  • Integrates seamlessly with pre-commit
  • Helps ensure license compliance across your project

Usage

  1. Install pre-commit (if not already):

    pip install pre-commit
  2. 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]
  3. Install the hook:

    pre-commit install

Requirements

  • Python >=3.11 for Linux and MacOS (ARM only)
  • Python >=3.11 for Windows
  • spdx-checker

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages