Skip to main content

Code Standards

This document defines the code standards enforced through Ruff, MyPy, and Pytest.

Python Version

  • Minimum: 3.11
  • Target: 3.11, 3.12, 3.13
  • Package Manager: UV with workspace configuration

Code Style

Ruff Configuration

Naming Conventions

Imports

Type Safety

MyPy Configuration

Type Annotations

Async Patterns

All I/O operations must be async:

Error Handling

Exception Hierarchy

Pattern

Testing Standards

Structure

Conventions

  • Coverage Target: ≥80% per package
  • Async Tests: Use @pytest.mark.asyncio
  • Naming: test_<function_name> or test_<scenario>

Documentation Standards

Security

Never hardcode credentials. Always use environment variables.

Path Validation

Conventional Commits

All commits must follow Conventional Commits format:

Commands Reference