You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add return types to public functions and methods.
99
+
- Add type hints to all function signatures (parameters and return types), not just public ones.
100
100
- Prefer `BaseSettings` and `BaseModel` type annotations for config/DTOs.
101
101
-`ty` runs in CI; avoid `Any` unless required and explain why in code.
102
+
- Use `NewType` to distinguish domain identifiers that share an underlying primitive (e.g., `MinerUID`, `BlockNumber`, `EnvironmentId`, `Hotkey`). This prevents accidental misuse such as passing a `MinerUID` where a `BlockNumber` is expected.
103
+
- Centralise shared newtypes, type aliases, enums, and `TypedDict` definitions in `kinitro/types.py`. Import from there rather than re-defining types locally.
104
+
- When introducing a new domain concept that is fundamentally a `str`, `int`, or other primitive, create a `NewType` for it in `kinitro/types.py` and use it consistently across signatures, models, and data structures.
105
+
- Prefer `TypedDict` or `dataclasses.dataclass` over plain `dict` for structured data with known keys.
0 commit comments