Skip to content

cwahyu/pathcrumb

Repository files navigation

pathcrumb

Keep Python file headers aligned with their relative file paths.

Installation

pipx install pathcrumb

Usage

pathcrumb fix
pathcrumb check

Examples

Add or update headers:

pathcrumb fix
pathcrumb fix src

Check for missing headers:

pathcrumb check
pathcrumb check --fail-on-missing

Preview changes:

pathcrumb fix --dry-run

CI mode:

pathcrumb fix --check

Configuration

Configure via pyproject.toml:

[tool.pathcrumb]
target = ["src"]
ignore = ["tests"]

Behavior

Each Python file should begin with:

# path/to/file.py

Structure:

shebang (optional)
path header
comment block (optional)

code

Pre-commit

repos:
  - repo: https://github.com/cwahyu/pathcrumb
    rev: v0.2.0
    hooks:
      - id: pathcrumb-fix
      - id: pathcrumb-check

Development

uv run pytest

License

MIT

About

Keep Python file headers aligned with their relative file paths.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages