A
.gitignore-aware file discovery and classification suite that locates files by content format, shebang, and MIME tag for automated linting, formatting, and CI pipelines.
1. Why findfmt?
Unlike traditional find or globbing tools that rely strictly on file extensions, findfmt:
- Understands file content: Identifies format by content, shebang (
#!/usr/bin/env python3), and MIME types using theidentifyengine. - Respects Git: Traverses trees hierarchically while pruning
.gitignoreand.git/info/excludepaths early before descending into large directories (e.g.node_modules/,.venv/). - Deterministic: Always returns clean, relative, deterministically sorted paths optimized for subshells, xargs, and automation.
2. Installation
2.1. With uv (Recommended)
Run directly with uvx:
uvx findfmt --help
Install globally:
uv tool install findfmt
Or add to your project:
uv add findfmt
2.2. With pip
pip install findfmt
2.3. With Docker / Container
docker pull ghcr.io/bdperkin/findfmt:latest
docker run --rm -v "$(pwd)":/workspace -w /workspace ghcr.io/bdperkin/findfmt:latest -t python
3. Usage
3.1. Locate Files by Tag / Format
# Locate all Python files
findfmt -t python
# Locate all YAML and JSON files
findfmt -t yaml,json
# Locate shell scripts
findfmt -t shell
3.2. Shebang Filtering
# Locate files with bash shebang
findfmt --shebang bash
# Locate scripts executing with python
findfmt --shebang python
3.3. Pipe Safely to Linters and Tools
Use -0 for NUL-delimited output with xargs -0:
# Format discovered Python files
findfmt -t python -0 | xargs -0 ruff format
# Lint shell scripts with shellcheck
findfmt -t shell -0 | xargs -r -0 shellcheck
3.4. Inspect Tags & Summaries
# Print matched files and their classification tags
findfmt -l -t python
# Print summary statistics to stderr
findfmt -s
4. CLI Options
| Flag | Description |
|---|---|
-t, --tag, --type |
Match files containing specified tag(s) |
-e, --exclude, --exclude-tag |
Exclude files containing specified tag(s) |
--all-tags |
Require match against all include tags (AND logic) |
--shebang |
Match shebang interpreter name or pattern |
--no-ignore |
Do not prune paths matching .gitignore |
--hidden |
Inspect hidden files and directories |
-0, --print0 |
NUL-delimited output for xargs -0 |
-l, --list-tags |
Print tags alongside file paths |
-s, --summary |
Print match frequencies to stderr |
--absolute |
Output absolute rather than relative paths |
--known-tags |
List all supported classification tags |
-v, --version |
Display version and exit |
5. Development & Testing
This project enforces 100% test coverage and strict type checking:
# Clone the repository
git clone https://github.com/bdperkin/findfmt.git
cd findfmt
# Install dependencies with uv
uv sync --all-groups
# Run tests and verify 100% coverage
uv run pytest
# Run linting and typing
uv run ruff check
uv run ty check
# Run full verification suite
uv run python tools/verify_quality.py
6. Governance & Community
7. License
MIT License © 2026 Brandon Perkins.
Metadata
Release files for findfmt 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| findfmt-0.1.0.tar.gz | 58.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| findfmt-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.0 kB
Release files / findfmt-0.1.0.tar.gz
| Download URL | findfmt-0.1.0.tar.gz |
|---|---|
| Size | 58.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
986872b2541215b7e95043c92b6f7ba6526bed54fc6559ccb0acfac2ae284416
|
|
BLAKE2b-256 checksum How to use checksums |
304bde3978df751d108512594877d0508d0aa5c2ae10616415a12945bc031067
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / findfmt-0.1.0-py3-none-any.whl
| Download URL | findfmt-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4079e6d8109b18b324a9d0fc73997c1b32b11250213df4122ea028b58f0f1ba0
|
|
BLAKE2b-256 checksum How to use checksums |
5497ee41fbad4b77e4bbd071840dc4e15d1e9cff9575ccfb0bb0dcd3c9e9e352
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log