Contributing
Contributions are welcome! Here's how to get started.
Development Setup
-
Clone the repository:
-
Install development dependencies:
-
Install pre-commit hooks:
Running Tests
Tests use respx to mock HTTP calls, so no GitHub API access is needed.
Code Quality
The project uses several tools to maintain code quality:
Linting
Type Checking
All Checks
Pre-commit runs all checks automatically:
Project Structure
src/trueloc/
├── cli.py # Typer commands (count, count-local, clear-cache)
├── display.py # Rich table formatting and JSON output
├── github.py # GitHubClient - API calls with caching
├── local.py # Local git repo analysis (git log/show)
├── models.py # Pydantic-style dataclasses for stats
└── utils.py # Shared utilities (cache, token, date parsing)
Pull Request Guidelines
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes
- Run tests and linting
- Commit with a clear message
- Push and open a PR
Tech Stack
- Python 3.12+
- Typer - CLI framework
- httpx - HTTP client
- Rich - Terminal output
- diskcache - Persistent caching
- dateparser - Flexible date parsing
License
By contributing, you agree that your contributions will be licensed under the MIT License.