Thank you for your interest in contributing to path-comment-hook! This document provides guidelines and information for contributors.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/path-comment-hook.git cd path-comment-hook - Set up development environment:
poetry install poetry shell pre-commit install
- Run tests to ensure everything works:
make test
- Python 3.8+
- Poetry (for dependency management)
- Git
# Clone the repository
git clone https://github.com/Shorzinator/path-comment-hook.git
cd path-comment-hook
# Install dependencies
poetry install
# Activate virtual environment
poetry shell
# Install pre-commit hooks
pre-commit install
# Verify installation
make test
make lintWe use a Makefile for common development tasks:
# Run tests
make test
make test-cov # With coverage report
# Code quality
make lint # Run all linters
make format # Format code
make type-check # Type checking
# Documentation
make docs-serve # Serve docs locally
make docs-build # Build docs
# Full quality check
make check # Run all quality checks-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Write tests for new functionality
-
Run quality checks:
make check
-
Commit your changes using conventional commits:
git commit -m "feat: add new functionality" -
Push and create a pull request
We use Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat: add delete command functionality
fix: resolve Windows line ending issues
docs: update installation instructions
test: add comprehensive CLI tests- Line length: 100 characters max
- Formatting: Use Ruff for formatting
- Type hints: Required for all functions and methods
- Docstrings: Use Google-style docstrings
- Imports: Use absolute imports, sort with Ruff
def process_file(file_path: Path, project_root: Path, mode: str = "fix") -> Result:
"""Process a single file to add or check path headers.
Args:
file_path: Path to the file to process.
project_root: Root directory of the project.
mode: Processing mode, either "fix" or "check".
Returns:
Result enum indicating the outcome.
Raises:
FileHandlingError: If file cannot be processed.
"""
# Implementation hereWe use pre-commit hooks to ensure code quality:
- Ruff: Linting and formatting
- MyPy: Type checking
- Trailing whitespace: Remove trailing whitespace
- End of file: Ensure files end with newline
Before creating a new issue:
- Search existing issues for duplicates
- Check the documentation for solutions
- Test with the latest version
When reporting bugs, include:
- Operating system and Python version
- path-comment-hook version
- Complete error messages
- Steps to reproduce
- Expected vs actual behavior
Releases are automated but follow this process:
- Update version in
pyproject.toml - Update CHANGELOG.md with release notes
- Create release PR with version bump
- Merge to main triggers automated release
- GitHub Actions handles PyPI publishing
Contributors are recognized in:
- Release notes
- GitHub contributors page
- Special mentions for significant contributions
Thank you for contributing to path-comment-hook!
By contributing, you agree that your contributions will be licensed under the same MIT License that covers the project.
Thank you for contributing to path-comment-hook! 🎉