Skip to content

Commit dc3a978

Browse files
MARSclaude
andcommitted
fix(lint): resolve ruff C901+F841 in new detectors
Move # noqa: C901 to the def line (black splits multi-line signatures, so the suppression must be on the first line ruff reports). Remove unused text_lower (grant_funding_trails) and version_date (vote_date_alignment). All four files now pass black --check and ruff check clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 053b859 commit dc3a978

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/oraculus_di_auditor/analysis/grant_funding_trails.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def _dollar_amounts(text: str) -> list[str]:
101101
# ---------------------------------------------------------------------------
102102

103103

104-
def detect_grant_funding_trail_anomalies(doc: dict[str, Any]) -> list[dict[str, Any]]:
104+
def detect_grant_funding_trail_anomalies( # noqa: C901
105+
doc: dict[str, Any],
106+
) -> list[dict[str, Any]]:
105107
"""Detect missing or broken grant funding trail signals in *doc*."""
106108
findings: list[dict[str, Any]] = []
107109
if not isinstance(doc, dict):
@@ -111,7 +113,6 @@ def detect_grant_funding_trail_anomalies(doc: dict[str, Any]) -> list[dict[str,
111113
if not text.strip():
112114
return findings
113115

114-
text_lower = text.lower()
115116
has_grant_ref = bool(_GRANT_REFERENCE.search(text))
116117
if not has_grant_ref:
117118
return findings # not a grant-related document

src/oraculus_di_auditor/analysis/vote_date_alignment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ def _extract_dates_from_text(text: str) -> list[date]:
135135
# ---------------------------------------------------------------------------
136136

137137

138-
def detect_vote_date_alignment_anomalies(doc: dict[str, Any]) -> list[dict[str, Any]]:
138+
def detect_vote_date_alignment_anomalies( # noqa: C901
139+
doc: dict[str, Any],
140+
) -> list[dict[str, Any]]:
139141
"""Detect vote / authorization vs. execution date misalignment in *doc*."""
140142
findings: list[dict[str, Any]] = []
141143
if not isinstance(doc, dict):
@@ -199,7 +201,6 @@ def detect_vote_date_alignment_anomalies(doc: dict[str, Any]) -> list[dict[str,
199201
# ------------------------------------------------------------------
200202
auth_date = _parse_iso(doc.get("authorization_date") or doc.get("approval_date"))
201203
exec_date = _parse_iso(doc.get("execution_date") or doc.get("effective_date"))
202-
version_date = _parse_iso(doc.get("version_date"))
203204

204205
if auth_date and exec_date and exec_date < auth_date:
205206
findings.append(

0 commit comments

Comments
 (0)