Skip to content

Commit 32dd62c

Browse files
acailicclaude
andcommitted
fix: resolve lint errors and clean up coverage config
- Fix 5 ruff errors in scripts/hooks/ (import sorting, unused import, long lines) - Migrate .coveragerc into pyproject.toml [tool.coverage] section - Add .coveragerc to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4fc9eb7 commit 32dd62c

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ venv/
99

1010
.pytest_cache/
1111
.coverage
12+
.coveragerc
1213
coverage.xml
1314
htmlcov/
1415
.mypy_cache/

pyproject.toml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,34 @@ markers = [
8282
"integration: End-to-end tests requiring API keys (deselected by default)",
8383
]
8484

85-
[tool.coverage.report]
85+
[tool.coverage.run]
86+
source = ["agent_debugger_sdk", "api", "storage", "collector", "auth", "redaction"]
8687
omit = [
8788
"*/tests/*",
89+
"*/test_*.py",
90+
"*/__pycache__/*",
91+
"*/site-packages/*",
92+
"*/dist/*",
93+
"*/build/*",
94+
"*/.venv*",
95+
"*/migrations/*",
96+
]
97+
branch = true
98+
99+
[tool.coverage.report]
100+
precision = 2
101+
show_missing = true
102+
skip_covered = false
103+
sort = "Cover"
104+
exclude_lines = [
105+
"pragma: no cover",
106+
"def __repr__",
107+
"raise AssertionError",
108+
"raise NotImplementedError",
109+
"if __name__ == .__main__.:",
110+
"if TYPE_CHECKING:",
111+
"@abstractmethod",
112+
"@abc.abstractmethod",
88113
]
89114

90115
[tool.ruff]

scripts/hooks/check_layer_imports.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
- auth/ files should NOT import from api or collector
1010
"""
1111

12-
import sys
1312
import json
14-
import re
13+
import sys
1514
from pathlib import Path
1615

1716

@@ -43,7 +42,10 @@ def check_file_for_violations(file_path: str) -> dict:
4342
"forbidden_imports": ["from api ", "import api", "from storage ", "import storage",
4443
"from collector ", "import collector", "from auth ", "import auth",
4544
"from redaction ", "import redaction"],
46-
"reason": "SDK layer (agent_debugger_sdk/) should not import from server/runtime layers (api, storage, collector, auth, redaction)"
45+
"reason": (
46+
"SDK layer (agent_debugger_sdk/) should not import from "
47+
"server/runtime layers (api, storage, collector, auth, redaction)"
48+
)
4749
},
4850
# Storage layer should not import from API or collector
4951
{
@@ -67,7 +69,11 @@ def check_file_for_violations(file_path: str) -> dict:
6769
if forbidden in content:
6870
return {
6971
"decision": "deny",
70-
"reason": f"Architecture violation in {file_path.relative_to(Path.cwd())}: {rule['reason']}. Found forbidden import pattern: '{forbidden}'"
72+
"reason": (
73+
f"Architecture violation in "
74+
f"{file_path.relative_to(Path.cwd())}: {rule['reason']}. "
75+
f"Found forbidden import pattern: '{forbidden}'"
76+
)
7177
}
7278

7379
return {"decision": "allow"}

scripts/hooks/post_edit_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
This is informational only (exit 0 always) - just prints warnings.
1111
"""
1212

13-
import sys
1413
import subprocess
14+
import sys
1515
from pathlib import Path
1616

1717

0 commit comments

Comments
 (0)