Files
openttd-client/docs/CONTRIBUTING.md
kovagoadi aebd5f4ef5
Some checks failed
Continuous Integration / lint-and-security (pull_request) Failing after 39s
Continuous Integration / tests-and-coverage (pull_request) Successful in 24s
Add admin port support with other major refactorations
2026-06-29 19:47:48 +02:00

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 OpenTTDClient or OpenTTDProtocol classes.
  • 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

  1. Fork the repo and create your branch from main.
  2. Add tests for your changes.
  3. Run the full test suite to ensure no regressions and verify 100% coverage.
  4. Open a Pull Request with a detailed description of your changes.