Skip to content

Commit 754828e

Browse files
fix: resolve mypy type errors in analyzers/
- Renamed 'content' to 'main_content' and 'app_content' in python_analyzer.py to avoid type narrowing conflicts with earlier str-typed variable - Added type annotation for _analyzers list in stack_detector.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 79bad24 commit 754828e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

analyzers/python_analyzer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ def can_analyze(self) -> tuple[bool, float]:
9090
# Check for common FastAPI patterns
9191
main_py = self.project_dir / "main.py"
9292
if main_py.exists():
93-
content = self._read_file_safe(main_py)
94-
if content and "from fastapi import" in content:
93+
main_content = self._read_file_safe(main_py)
94+
if main_content and "from fastapi import" in main_content:
9595
self._detected_stack = "fastapi"
9696
return True, 0.9
9797

9898
# Check for Flask patterns
9999
app_py = self.project_dir / "app.py"
100100
if app_py.exists():
101-
content = self._read_file_safe(app_py)
102-
if content and "from flask import" in content:
101+
app_content = self._read_file_safe(app_py)
102+
if app_content and "from flask import" in app_content:
103103
self._detected_stack = "flask"
104104
return True, 0.85
105105

analyzers/stack_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, project_dir: Path):
5757
project_dir: Path to the project directory to analyze
5858
"""
5959
self.project_dir = Path(project_dir).resolve()
60-
self._analyzers = []
60+
self._analyzers: list = []
6161
self._load_analyzers()
6262

6363
def _load_analyzers(self) -> None:

0 commit comments

Comments
 (0)