Keep Python file headers aligned with their relative paths
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pathcrumb-0.2.0.tar.gz
(35.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathcrumb-0.2.0.tar.gz.
File metadata
- Download URL: pathcrumb-0.2.0.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87e2298a5b8beea80529b1277ec02ed3356a804487af87e5bac4d6f1871ffbd3
|
|
| MD5 |
c16cb520ca39d51aceb5e8dc29858e0e
|
|
| BLAKE2b-256 |
15d689497e2be94a4719d09591883105d5ba28faecaa77a6a15851c379556ac6
|
File details
Details for the file pathcrumb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pathcrumb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4faedea42ba5fd47833c37e7fb7d3e2c6fb550a95c044990b8f74be9349dc2a
|
|
| MD5 |
d6241faa8d0a01a9392abe16f2d41825
|
|
| BLAKE2b-256 |
81859f9ad7a3c647f03a5f02a487e3d8b341ddb07c53b81e03d115665445d99d
|