Skip to content

Fix type errors and enable pre commit#155

Open
benjibc wants to merge 2 commits intomainfrom
cursor/fix-type-errors-and-enable-pre-commit-22d9
Open

Fix type errors and enable pre commit#155
benjibc wants to merge 2 commits intomainfrom
cursor/fix-type-errors-and-enable-pre-commit-22d9

Conversation

@benjibc
Copy link
Copy Markdown
Contributor

@benjibc benjibc commented Sep 3, 2025


name: Pull Request
about: Propose changes to the codebase
title: "Fix type errors and enable pre-commit in CI"
labels: ''
assignees: ''


Description

This PR addresses several type errors across the codebase and integrates pre-commit hooks into the CI pipeline to enforce code quality and type checking for all future contributions.

Key Changes:

  • Type Error Fixes:
    • eval_protocol/rewards/function_calling.py: Added explicit casts for decorated callables to resolve type mismatches.
    • eval_protocol/rewards/lean_prover.py: Updated to use the typed reward_function decorator from eval_protocol.typed_interface.
    • eval_protocol/mcp_servers/tau2/tests/test_tau2_e2e.py: Ensured ToolMessage.id is consistently a string.
  • CI/CD Enhancements:
    • .github/workflows/ci.yml: Modified the CI workflow to run pre-commit run --all-files, replacing the standalone pyright check and removing its suppression.
    • .pre-commit-config.yaml: Added pre-commit>=3.7.0 as a dependency to support the CI changes.

Motivation:
To improve code reliability, maintainability, and ensure consistent code style and type safety across the project by preventing new type errors and style issues from being introduced.

Fixes # (issue)
Implements # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactoring/Code cleanup
  • Build/CI/CD related changes
  • Other (please describe):

How Has This Been Tested?

  • Type errors were identified and fixed based on basedpyright output.
  • pre-commit run --all-files was executed locally to verify all hooks pass.
  • The CI workflow has been updated to run these checks on every push/PR.

Test Configuration:

  • Firmware version: N/A
  • Hardware: N/A
  • Toolchain: Python 3.10+
  • SDK: N/A

Checklist:

  • My code follows the style guidelines of this project (ran black ., isort ., flake8 .)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (pre-commit in CI)
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots (if applicable)

N/A

Additional context

This change establishes a baseline for type safety and code quality, ensuring future contributions adhere to defined standards.


Open in Cursor Open in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Sep 3, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@benjibc benjibc marked this pull request as ready for review September 3, 2025 11:22
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.

2 participants