|
| 1 | +# Contributing to TimeRun |
| 2 | + |
| 3 | +Thank you for your interest in contributing to TimeRun! This document provides guidelines for contributing to the project. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Python 3.9 or higher |
| 10 | +- Git |
| 11 | + |
| 12 | +### Development Setup |
| 13 | + |
| 14 | +1. Fork the repository on GitHub |
| 15 | +2. Clone your fork locally: |
| 16 | + ```bash |
| 17 | + git clone https://github.com/YOUR_USERNAME/timerun.git |
| 18 | + cd timerun |
| 19 | + ``` |
| 20 | + |
| 21 | +3. Set up the development environment: |
| 22 | + ```bash |
| 23 | + make init |
| 24 | + ``` |
| 25 | + |
| 26 | +4. Activate the virtual environment: |
| 27 | + ```bash |
| 28 | + source .venv/bin/activate |
| 29 | + ``` |
| 30 | + |
| 31 | +## Development Workflow |
| 32 | + |
| 33 | +### Running Tests |
| 34 | + |
| 35 | +Run the test suite with coverage: |
| 36 | +```bash |
| 37 | +make test |
| 38 | +``` |
| 39 | + |
| 40 | +### Code Style |
| 41 | + |
| 42 | +This project follows these code style guidelines: |
| 43 | +- **Black** for code formatting (line length: 79 characters) |
| 44 | +- **isort** for import sorting |
| 45 | + |
| 46 | +Pre-commit hooks are installed automatically with `make init` and will run on every commit. You can also run them manually: |
| 47 | +```bash |
| 48 | +pre-commit run --all-files |
| 49 | +``` |
| 50 | + |
| 51 | +### Making Changes |
| 52 | + |
| 53 | +1. Create a new branch for your feature or bugfix: |
| 54 | + ```bash |
| 55 | + git checkout -b feature/your-feature-name |
| 56 | + ``` |
| 57 | + |
| 58 | +2. Make your changes following the project conventions |
| 59 | +3. Add or update tests as needed |
| 60 | +4. Ensure all tests pass: `make test` |
| 61 | +5. Commit your changes with a clear message |
| 62 | + |
| 63 | +### Submitting Changes |
| 64 | + |
| 65 | +1. Push your branch to your fork: |
| 66 | + ```bash |
| 67 | + git push origin feature/your-feature-name |
| 68 | + ``` |
| 69 | + |
| 70 | +2. Create a pull request on GitHub with: |
| 71 | + - Clear description of the changes |
| 72 | + - Reference to any related issues |
| 73 | + - Test coverage for new functionality |
| 74 | + |
| 75 | +## Project Structure |
| 76 | + |
| 77 | +- `timerun.py` - Main library code (single file module) |
| 78 | +- `tests/` - Test suite |
| 79 | +- `pyproject.toml` - Project configuration and dependencies |
| 80 | +- `Makefile` - Development commands |
| 81 | + |
| 82 | +## Guidelines |
| 83 | + |
| 84 | +### Code Quality |
| 85 | + |
| 86 | +- Maintain 100% test coverage for new code |
| 87 | +- Follow existing code patterns and conventions |
| 88 | +- Add docstrings for all public functions and classes |
| 89 | +- Use type hints consistently |
| 90 | + |
| 91 | +### Testing |
| 92 | + |
| 93 | +- Write tests for all new functionality |
| 94 | +- Use descriptive test names |
| 95 | +- Test both success and error cases |
| 96 | +- Keep tests focused and independent |
| 97 | + |
| 98 | +### Documentation |
| 99 | + |
| 100 | +- Update docstrings for any API changes |
| 101 | +- Add examples for new features |
| 102 | +- Update README.md if needed |
| 103 | + |
| 104 | +## Reporting Issues |
| 105 | + |
| 106 | +When reporting bugs or requesting features: |
| 107 | + |
| 108 | +1. Check existing issues first |
| 109 | +2. Use the issue templates if available |
| 110 | +3. Provide clear reproduction steps for bugs |
| 111 | +4. Include Python version and environment details |
| 112 | + |
| 113 | +## Questions? |
| 114 | + |
| 115 | +Feel free to open an issue for questions about contributing or reach out to the maintainers. |
| 116 | + |
| 117 | +## License |
| 118 | + |
| 119 | +By contributing to TimeRun, you agree that your contributions will be licensed under the MIT License. |
0 commit comments