1.3 KiB
1.3 KiB
Contributing to OpenTTD Python Client
We welcome contributions from the community! To maintain the high quality of this library, please follow these guidelines.
Code Standards
- Clean OO Code: Logic must be encapsulated within the
OpenTTDClientorOpenTTDProtocolclasses. - Type Safety: Use type hints where possible.
- Minimal Dependencies: Only add new dependencies if absolutely necessary.
Testing Mandate
We enforce 100% test coverage for normal (non-E2E) tests. Any new feature or bug fix must include corresponding tests and maintain this coverage standard. E2E tests are only required to cover every public function with multiple inputs, and do not require 100% code coverage.
Running Tests
For detailed testing instructions, please refer to the Testing Guide.
Quick command to run normal (non-E2E) tests:
./venv/bin/pytest -m "not e2e"
Quick command to run all tests (including E2E):
./venv/bin/pytest
Submitting Changes
- Fork the repo and create your branch from
main. - Add tests for your changes.
- Run the full test suite to ensure no regressions and verify 100% coverage.
- Open a Pull Request with a detailed description of your changes.