path-comment-hook¶
Add file path headers to your source code automatically.
Never lose track of where you are in large codebases. This pre-commit hook automatically adds file path comments to the top of your source files, making code navigation effortless.
-
Set up in 5 minutes
Install with pip and integrate with pre-commit in minutes.
-
Better Code Navigation
Know exactly where you are in large codebases.
-
Highly Configurable
Customize comment styles, exclusions, and more.
-
Multi-Language Support
Works with Python, JavaScript, TypeScript, C/C++, and more.
Quick Example¶
Installation¶
Pre-commit Integration¶
Add to your .pre-commit-config.yaml
:
repos:
- repo: https://github.com/Shorzinator/path-comment-hook
rev: v0.3.0 # Use the latest version
hooks:
- id: path-comment
Key Features¶
- Fast: Parallel processing for large codebases
- Configurable: Customize comment styles and exclusions
- Multi-language: Support for 10+ programming languages
- Zero dependencies: Lightweight and reliable
- Reversible: Easy to add or remove headers
- Smart detection: Handles shebangs and encoding automatically
Quick Start¶
-
Install the hook:
-
Add to pre-commit config:
-
Run on your project:
That's it! Your files now have path headers for better navigation.
What's Next?¶
- Quick Start Guide - Get up and running in 5 minutes
- User Guide - Learn all the commands and options
- Configuration - Customize for your project
- Pre-commit Setup - Integrate with your workflow
Community¶
- GitHub Issues - Report bugs or request features
- GitHub Discussions - Ask questions and share ideas
- Contributing Guide - Help improve the project
path-comment-hook is open source and available under the MIT license.