Keep Python file headers aligned with their relative file paths.
pipx install pathcrumbpathcrumb fix
pathcrumb checkAdd or update headers:
pathcrumb fix
pathcrumb fix srcCheck for missing headers:
pathcrumb check
pathcrumb check --fail-on-missingPreview changes:
pathcrumb fix --dry-runCI mode:
pathcrumb fix --checkConfigure via pyproject.toml:
[tool.pathcrumb]
target = ["src"]
ignore = ["tests"]Each Python file should begin with:
# path/to/file.pyStructure:
shebang (optional)
path header
comment block (optional)
code
repos:
- repo: https://github.com/cwahyu/pathcrumb
rev: v0.2.0
hooks:
- id: pathcrumb-fix
- id: pathcrumb-checkuv run pytestMIT