DEL
This commit is contained in:
69
todos/005-completed-p3-code-cleanup.md
Normal file
69
todos/005-completed-p3-code-cleanup.md
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
status: pending
|
||||
priority: p3
|
||||
issue_id: "005"
|
||||
tags: ["cleanup", "quality", "python"]
|
||||
dependencies: []
|
||||
---
|
||||
|
||||
# General Code Quality Cleanup
|
||||
|
||||
Address various code quality issues including unused arguments, type ignores, and list optimizations.
|
||||
|
||||
## Problem Statement
|
||||
|
||||
Multiple reviewers identified smaller code quality issues that accumulate to technical debt. These include unused arguments in `workflow.py`, specific type ignores in `db.py`, and list comprehension optimizations in `core.py`.
|
||||
|
||||
## Findings
|
||||
|
||||
1. **`src/helia/assessment/core.py`**:
|
||||
- Optimize list comprehension.
|
||||
2. **`src/helia/agent/workflow.py`**:
|
||||
- Rename unused `state` arguments to `_state`.
|
||||
3. **`src/helia/assessment/core.py`**:
|
||||
- Use dependency injection for `PHQ8Evaluator`.
|
||||
4. **`src/helia/db.py`**:
|
||||
- PGH003: Narrow `type: ignore` to `type: ignore[arg-type]`.
|
||||
5. **General**:
|
||||
- Recommends generator expression for join operations.
|
||||
|
||||
## Proposed Solutions
|
||||
|
||||
### Option 1: Batch Cleanup
|
||||
|
||||
**Approach:** Go through each file and apply the specific fix.
|
||||
|
||||
**Pros:**
|
||||
- Cleans up "broken windows".
|
||||
- Improves linting scores.
|
||||
|
||||
## Recommended Action
|
||||
|
||||
**To be filled during triage.**
|
||||
|
||||
## Technical Details
|
||||
|
||||
**Affected files:**
|
||||
- `src/helia/assessment/core.py`
|
||||
- `src/helia/agent/workflow.py`
|
||||
- `src/helia/db.py`
|
||||
|
||||
## Resources
|
||||
|
||||
- **Source:** Kieran Python Reviewer, Security Sentinel, Pattern Recognition Specialist
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] `src/helia/assessment/core.py`: List comprehension optimized.
|
||||
- [ ] `src/helia/agent/workflow.py`: Unused args renamed to `_state`.
|
||||
- [ ] `src/helia/db.py`: `type: ignore` narrowed.
|
||||
- [ ] `src/helia/assessment/core.py`: Dependency injection pattern reviewed/applied.
|
||||
|
||||
## Work Log
|
||||
|
||||
### 2025-12-20 - Initial Creation
|
||||
|
||||
**By:** Claude Code
|
||||
|
||||
**Actions:**
|
||||
- Created todo based on aggregated code review findings.
|
||||
Reference in New Issue
Block a user