API Reference¶
This section documents the Python API for pre-commit-snippets.
Package Structure¶
pre_commit_snippet/
├── __init__.py # Package init, exports main()
├── cache.py # Hash computation and caching
├── cli.py # Command-line interface
├── config.py # Configuration loading
├── git.py # Git operations
├── logging.py # Logging configuration
└── snippet.py # Snippet replacement logic
Modules¶
| Module | Description |
|---|---|
| cli | Main entry point and argument parsing |
| config | Configuration loading and validation |
| cache | Hash computation and cache management |
| git | Git operations (clone, stage, etc.) |
| snippet | Core snippet replacement logic |
| logging | Logging configuration |