Skip to content

pivotal-energy-solutions/pre-commit-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pivotal Pre-Commit Hooks

Pre-commit hooks for Pivotal Energy Solutions Python projects.

Installation

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/.*\.py

Hooks

copyright-checker

Checks 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-checker

Usage in CI (check-only mode):

copyright-checker --check-only path/to/file.py

Development

# Install with uv
uv sync --dev

# Run tests
uv run pytest

# Format code
uv run ruff format .
uv run ruff check --fix .

About

Pre-Commit Hooks For Pivotal

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages