Skip to content

chore: resolve pre-commit hook failures and enforce them in CI#155

Merged
jeanscherf merged 5 commits into
mainfrom
fix/pre-commit-type-errors
Jun 10, 2026
Merged

chore: resolve pre-commit hook failures and enforce them in CI#155
jeanscherf merged 5 commits into
mainfrom
fix/pre-commit-type-errors

Conversation

@jeanscherf

@jeanscherf jeanscherf commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix all ty type check errors that were blocking pre-commit:
    • Use MessageRole.USER enum instead of the "USER" string literal in agent memory BDD test
    • Add assert token is not None before lambda: token to narrow Optional[str] to str (matches Callable[[], str])
    • Move top-level langgraph/langchain_core imports inside the try/except block in _agent.py and add # ty: ignore[unresolved-import] for optional deps not present in the venv
    • Annotate DummyResponse.headers as Mapping[str, str] so it satisfies the _ResponseLike protocol
    • Remove two now-stale # ty: ignore suppression comments in DMS integration tests
  • Replace the individual ruff and ty steps in checks.yaml with a single pre-commit run --all-files step, which also enforces YAML validity and trailing-whitespace checks that were previously not covered in CI

Test plan

  • All pre-commit hooks pass locally (VIRTUAL_ENV=.venv pre-commit run --all-files)
  • checks.yaml CI job passes on this PR

@jeanscherf jeanscherf requested a review from a team as a code owner June 10, 2026 16:20

@LucasAlvesSoares LucasAlvesSoares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img

@jeanscherf jeanscherf changed the title fix: resolve pre-commit hook failures and enforce them in CI chore: resolve pre-commit hook failures and enforce them in CI Jun 10, 2026
Fix all ty type check errors surfaced by running pre-commit:
- Use MessageRole.USER enum instead of "USER" string literal
- Narrow Optional[str] to str before passing to lambda to match Callable[[], str]
- Move top-level langgraph/langchain_core imports inside try/except and add ty: ignore for optional deps not in venv
- Annotate DummyResponse.headers as Mapping[str, str] to satisfy _ResponseLike protocol
- Remove now-stale ty: ignore suppression comments in DMS tests

Also replace the individual ruff/ty steps in checks.yaml with a single
pre-commit run so the YAML validity and whitespace checks are also enforced
in CI alongside formatting and type checking.
@jeanscherf jeanscherf force-pushed the fix/pre-commit-type-errors branch from dd7b2f6 to 5f00aa5 Compare June 10, 2026 16:55
@jeanscherf jeanscherf merged commit e953cfe into main Jun 10, 2026
10 of 11 checks passed
@jeanscherf jeanscherf deleted the fix/pre-commit-type-errors branch June 10, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants