Pre-commit hooks for Pivotal Energy Solutions Python projects.
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/pivotal-energy-solutions/pre-commit-hooks
rev: v1.0.0
hooks:
- id: copyright-checker
exclude: manage.py|wsgi.py|migrations/.*\.pyChecks and auto-fixes copyright headers in Python files.
Features:
- Checks for required metadata:
__author__,__date__,__copyright__,__credits__ - Auto-fixes outdated copyright years (e.g., 2025 → 2026)
- Suggests git user name for missing author/credits
- Flags placeholder text like
<FULL_NAME>that wasn't replaced
Usage in pre-commit (auto-fix mode):
- id: copyright-checkerUsage in CI (check-only mode):
copyright-checker --check-only path/to/file.py# Install with uv
uv sync --dev
# Run tests
uv run pytest
# Format code
uv run ruff format .
uv run ruff check --fix .