chore: make CI green (ruff lint + format, mypy strict) - #6
Merged
Conversation
CI had been red for months on lint/format/type debt unrelated to any feature. This brings all three CI steps to green with no behavioral change. ruff: - ignore the ambiguous-unicode rules (RUF001/002/003) — intentional typography (em dashes, curly quotes, arrows) in prose docstrings/comments; - apply safe autofixes (unused imports, import sorting, stale noqa, collections.abc), fix 2x SIM105 (contextlib.suppress) and 1x E402 (noqa). format: - apply `ruff format` across the tree (whitespace only). mypy (strict): - add missing generic args (dict[str, Any], Callable[..., Any]); - match the langchain HITL overrides to the base (Sequence[BaseMessage]) and add a `messages` setter; cast the Any-returning _dump/_run helpers; - add langchain_core/mcp to ignore_missing_imports and relax disallow_subclassing_any / disallow_untyped_decorators for the two optional-dep integration shims (their bases are absent in the lint env). Verified: ruff check + ruff format --check + `mypy src/` all pass with the CI dependency set (optional deps absent); full unit suite (396) still green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI has been failing on every push for months — pre-existing lint/format/type debt, unrelated to any feature. This turns all three CI steps green with no behavioral change (full unit suite still passes).
What
ruff check
RUF001/002/003) — intentional typography (em dashes, curly quotes, arrows) in prose docstrings/comments.noqa,collections.abcimports.SIM105→contextlib.suppress(×2); one legitimateE402gets anoqa.ruff format
ruff formatacross the tree — whitespace only.mypy (strict)
dict[str, Any],Callable[..., Any]).Sequence[BaseMessage]) + amessagessetter;cast(...)on theAny-returning_dump/_runhelpers.langchain_core/mcpadded toignore_missing_imports;disallow_subclassing_any/disallow_untyped_decoratorsrelaxed only for the two optional-dep integration shims (their bases are absent in the lint env, which only installssqlite-vec).Verification
All three CI steps were run locally against the CI dependency set (optional deps uninstalled, matching
uv sync --group dev --extra sqlite-vec):ruff check .— cleanruff format --check .— cleanmypy src/—Success: no issues foundpytest -m "not integration and not benchmark"— 396 passedThe
(str, Enum)classes keep their existing per-line# noqa: UP042(StrEnum would change__str__); no runtime code changed.