Skip to content

Commit 2e5a275

Browse files
committed
fix: address more Copilot review feedback
- Fix should_analyze_file() to use relative path parts instead of absolute - Add [build-system] table to pyproject.toml for uv pip install - Fix snapshot path in skill docs and session_start.py (use repo root) - Rename open_issues_count to recent_issues_count (reflects --limit 5)
1 parent 2d5ce13 commit 2e5a275

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

.github/hooks/scripts/session_start.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_issue_context(repo_root: Path) -> Dict:
8989
if issues_json:
9090
try:
9191
issues = json.loads(issues_json)
92-
context["open_issues_count"] = len(issues)
92+
context["recent_issues_count"] = len(issues)
9393
context["recent_issues"] = [
9494
f"#{i['number']}: {i['title']}" for i in issues[:3]
9595
]
@@ -102,7 +102,7 @@ def get_issue_context(repo_root: Path) -> Dict:
102102

103103
def get_snapshot_summary(repo_root: Path) -> Dict:
104104
"""Get snapshot summary if available."""
105-
snapshot_path = repo_root / "analysis" / "analysis-snapshot.json"
105+
snapshot_path = repo_root / "analysis-snapshot.json"
106106
if not snapshot_path.exists():
107107
return {}
108108

@@ -149,7 +149,7 @@ def main() -> int:
149149
parts.append(f"Uncommitted changes: {changes} files")
150150

151151
if issue_context.get("recent_issues"):
152-
parts.append(f"Open issues: {issue_context.get('open_issues_count', 0)}")
152+
parts.append(f"Recent issues: {issue_context.get('recent_issues_count', 0)}")
153153

154154
if snapshot_context:
155155
if snapshot_context.get("fixme_count", 0) > 0:

.github/skills/generate-snapshot/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ This skill generates a comprehensive code health snapshot using the analysis mod
2020

2121
```powershell
2222
cd analysis
23-
python snapshot.py --output ./analysis-snapshot.json
23+
python snapshot.py --output ../analysis-snapshot.json
2424
```
2525

2626
Add `--pretty` flag to also print the JSON to stdout.
2727

28+
**Note:** The snapshot is written to the repository root (`analysis-snapshot.json`), not inside the `analysis/` folder. This path is ignored by `.gitignore`.
29+
2830
## Snapshot Structure
2931

3032
The snapshot contains these sections:

analysis/complexity_analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def should_analyze_file(
9595
".git",
9696
".vscode-test",
9797
}
98-
for part in filepath.parts:
98+
# Use relative path parts to avoid matching directories in repo root path
99+
rel_parts = filepath.relative_to(repo_root).parts
100+
for part in rel_parts:
99101
if part in skip_dirs:
100102
return False
101103

analysis/debt_indicators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def should_analyze_file(
115115
".git",
116116
".vscode-test",
117117
}
118-
for part in filepath.parts:
118+
# Use relative path parts to avoid matching directories in repo root path
119+
rel_parts = filepath.relative_to(repo_root).parts
120+
for part in rel_parts:
119121
if part in skip_dirs:
120122
return False
121123

analysis/dependency_analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def should_analyze_file(
8989
".git",
9090
".vscode-test",
9191
}
92-
for part in filepath.parts:
92+
# Use relative path parts to avoid matching directories in repo root path
93+
rel_parts = filepath.relative_to(repo_root).parts
94+
for part in rel_parts:
9395
if part in skip_dirs:
9496
return False
9597

analysis/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
15
[project]
26
name = "vscode-python-environments-analysis"
37
version = "0.1.0"

0 commit comments

Comments
 (0)