Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use local ruff and mypy for pre-commit checks #388

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Aug 16, 2024

Ensures that the checks run by pre-commit are the same as the ones run in CI, and the ruff and mypy versions are always controlled by pyproject.toml.
Before, we used pre-commit actions with their own versions that needed to be updated separately and tended to get out of date.

drive-by: Fix ruff lints added in the latest version

@aborgna-q aborgna-q requested a review from a team as a code owner August 16, 2024 15:51
@aborgna-q aborgna-q requested a review from qartik August 16, 2024 15:51
@qartik
Copy link
Member

qartik commented Aug 16, 2024

Would it make sense to instead call pre-commit in the CI? See #66. We do it in pytket-phir

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.88%. Comparing base (81f65f7) to head (afc9112).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #388   +/-   ##
=======================================
  Coverage   90.88%   90.88%           
=======================================
  Files          48       48           
  Lines        5340     5340           
=======================================
  Hits         4853     4853           
  Misses        487      487           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aborgna-q
Copy link
Collaborator Author

pre-commit is an all-in-one check that includes (some) tests as well as linting.

In the CI checks we get to be more granular, and have individual steps for lints as well as multiple steps for testing (with validation, pytket rountrips, coverage, ...).

I think those are different enough targets/envs to merit separate definitions.

@aborgna-q aborgna-q requested a review from mark-koch August 19, 2024 09:51
Copy link
Collaborator

@mark-koch mark-koch left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@aborgna-q aborgna-q added this pull request to the merge queue Aug 20, 2024
Merged via the queue into main with commit 0fdbbbb Aug 20, 2024
5 checks passed
@aborgna-q aborgna-q deleted the ab/local-ruff-mypy branch August 20, 2024 08:44
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.

4 participants