Skip to content

Upgrade Pyright from basic to strict mode #291

@nitrobass24

Description

@nitrobass24

Summary

After completing #249 (Pyright basic mode with 0 errors), upgrade to strict mode for comprehensive type safety enforcement.

Context

#249 adopts Pyright in basic mode which catches:

  • None safety (reportOptionalMemberAccess)
  • Argument type mismatches (reportArgumentType)
  • Attribute access on wrong types (reportAttributeAccessIssue)
  • Invalid calls (reportCallIssue)

Strict mode additionally enforces:

  • All function parameters must have type annotations
  • All return types must be declared
  • No implicit Any types
  • No unknown member accesses
  • Stricter generic type checking

Prerequisites

Implementation

  1. Switch pyrightconfig.json from "typeCheckingMode": "basic" to "strict"
  2. Audit new errors — likely hundreds of missing annotations, especially in:
    • Test files (most functions unannotated)
    • Callback parameters
    • Dynamic patterns in config.py
  3. Fix incrementally or use # type: ignore where annotation burden outweighs value
  4. Consider per-directory strict vs basic via pyrightconfig.json executionEnvironments

Acceptance criteria

  • pyrightconfig.json set to strict mode
  • 0 Pyright errors
  • CI enforcing strict mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions