-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
refactoringCode restructuring without changing external behaviorCode restructuring without changing external behavior
Description
Summary
The new release-smartem-agent.yml workflow introduced pyright type checking for src/smartem_agent and src/smartem_common. This revealed 140 pre-existing type errors that were never caught because the main CI workflow had linting commented out (# TODO restore).
Context
- PR feat: implement smartem-agent release architecture #213 adds the release workflow with pyright checking
- The main CI workflow (
ci.yml) has type checking disabled:# TODO restore # lint: # ... # with: # tox: pre-commit,type-checking
- Current pyright config in
pyproject.toml:[tool.pyright] typeCheckingMode = "standard" reportMissingImports = false
Error Categories
The 140 errors fall into several categories:
reportArgumentType- Arguments withNonepassed where non-optional types expectedreportOptionalMemberAccess- Accessing attributes on potentiallyNonevaluesreportAttributeAccessIssue- Unknown attributes (e.g.,lxml.etree)reportReturnType- Return type mismatchesreportAssignmentType- Type mismatches in assignmentsreportGeneralTypeIssues- Various other type issues
Files Affected
src/smartem_agent/event_processor.pysrc/smartem_agent/fs_parser.pysrc/smartem_agent/fs_watcher.pysrc/smartem_agent/model/store.pysrc/smartem_agent/orphan_manager.pysrc/smartem_common/schemas.py- And others
Recommended Approach
- Phase 1: Add proper type annotations to function signatures
- Phase 2: Fix
reportOptionalMemberAccesserrors with proper null checks - Phase 3: Fix
reportArgumentTypeerrors by validating inputs - Phase 4: Address remaining miscellaneous errors
Workaround for PR #213
The release workflow's pyright check needs to be relaxed until this technical debt is addressed. Options:
- Change
typeCheckingModeto"basic"temporarily - Add specific error codes to ignore in pyproject.toml
- Remove pyright from the release workflow lint step temporarily
Related
- PR feat: implement smartem-agent release architecture #213: Release architecture that introduced the pyright check
- Issue Fix reportOptionalMemberAccess errors in event_processor.py #214: Specific
reportOptionalMemberAccessfixes in event_processor.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
refactoringCode restructuring without changing external behaviorCode restructuring without changing external behavior