From 4c77bc5c11691c31aca7c182fede9f045afbc833 Mon Sep 17 00:00:00 2001 From: squid-protocol Date: Thu, 10 Sep 2026 17:52:47 -0400 Subject: [PATCH] fix(ci): restore ruff/mypy audit green after #2555 -- format + baseline line-shifts The #2555 merge (a550042f) tripped the two pull_request-only audit workflows (mypy-audit, ruff-audit); every other CI leg -- muninn, full-suite, both crucible legs, smoke-test on all platforms, CodeQL -- passed. These audits run only on `pull_request`, not on push to main, so the auto-merge landed the change before they could gate it. Two causes, both addressed here: - ruff format (zero-tolerance): the new `doc_languages` set comprehension in _get_dominant_lang exceeded the line limit; wrapped to be `ruff format`-clean. - Baseline line-shifts (NOT new findings): the #2555 edits pushed two pre-existing baselined findings down by a few lines. Updated the keys to match -- ruff C401 guidestar_lens.py 139 -> 149 (the has_intent Sector-Bias generator), mypy assignment galaxyscope.py 368 -> 370. Baseline keys are {file}:{line}: {code} and the CI check is keys-only, so these are the exact line numbers CI's pinned ruff 0.16.0 / mypy will compute. Baselines re-normalized to the documented json.dump(indent=2, sort_keys=True) form. Verified locally: `ruff_audit.py --ci` and `mypy_audit.py --ci` both report no new findings beyond baseline; signal_processor + #2555 tests pass. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01SpojRfky4j31UMHLDcPdto --- gitgalaxy/metrics/signal_processor.py | 3 ++- tests/mypy_audit_baseline.json | 2 +- tests/ruff_audit_baseline.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gitgalaxy/metrics/signal_processor.py b/gitgalaxy/metrics/signal_processor.py index 36032e2f2..c1a6c9164 100644 --- a/gitgalaxy/metrics/signal_processor.py +++ b/gitgalaxy/metrics/signal_processor.py @@ -2124,7 +2124,8 @@ def _get_dominant_lang(self, composition: dict[str, dict[str, Any]]) -> str: # take the impact-argmax over code languages first and only fall back to the # full set (docs included) when there is no code language present at all. doc_languages = { - lang.lower() for lang in self.asset_masks.get("DOCUMENTATION_LANGUAGES", {"markdown", "plaintext", "rst", "text"}) + lang.lower() + for lang in self.asset_masks.get("DOCUMENTATION_LANGUAGES", {"markdown", "plaintext", "rst", "text"}) } code_langs = {lang: stats for lang, stats in composition.items() if lang.lower() not in doc_languages} ranked = code_langs or composition diff --git a/tests/mypy_audit_baseline.json b/tests/mypy_audit_baseline.json index 7bdd9c552..82fec4405 100644 --- a/tests/mypy_audit_baseline.json +++ b/tests/mypy_audit_baseline.json @@ -1,4 +1,4 @@ { - "gitgalaxy/galaxyscope.py:368: assignment": "Incompatible types in assignment (expression has type \"TextIOWrapper\", variable has type \"BufferedReader\")", + "gitgalaxy/galaxyscope.py:370: assignment": "Incompatible types in assignment (expression has type \"TextIOWrapper[_WrappedBuffer]\", variable has type \"BufferedReader[_BufferedReaderStream]\")", "gitgalaxy/tools/network_auditing/full_api_network_map.py:32: assignment": "Incompatible types in assignment (expression has type \"None\", variable has type Module)" } \ No newline at end of file diff --git a/tests/ruff_audit_baseline.json b/tests/ruff_audit_baseline.json index 9684d2c0e..c915e637c 100644 --- a/tests/ruff_audit_baseline.json +++ b/tests/ruff_audit_baseline.json @@ -1,5 +1,5 @@ { - "gitgalaxy/core/guidestar_lens.py:139: C401": "Unnecessary generator (rewrite as a set comprehension)", + "gitgalaxy/core/guidestar_lens.py:149: C401": "Unnecessary generator (rewrite as a set comprehension)", "gitgalaxy/metrics/signal_processor.py:531: RUF046": "Value being cast to `int` is already an integer", "gitgalaxy/recorders/audit_recorder.py:293: C416": "Unnecessary dict comprehension (rewrite using `dict()`)", "gitgalaxy/recorders/audit_recorder.py:310: C414": "Unnecessary `list()` call within `sorted()`",