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

Add MyPy Hook to Pre-Commit and GitHub CI Workflow #65

Open
rlaphoenix opened this issue Oct 5, 2023 · 0 comments
Open

Add MyPy Hook to Pre-Commit and GitHub CI Workflow #65

rlaphoenix opened this issue Oct 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@rlaphoenix
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, MyPy linting is not enforced nor checked. Developers can of course still opt-in to using and following MyPy, but without it being enforced it sheds a lot of the weight on fixing and testing for MyPy on a smaller subset of the developers.

Describe the solution you'd like
Add the following to .pre-commit-config.yaml:

- repo: https://github.com/mtkennerly/pre-commit-hooks
  rev: v0.3.0
  hooks:
    - id: poetry-mypy

This should be used over other forms of MyPy hooks so that it installs and uses the Poetry-installed MyPy package instead of re-installing MyPy again somewhere else or under a different version.

For the GitHub CI Workflow, we could just remove the Ruff and isort calls and run pre-commit instead:

poetry run pre-commit run --all-files --show-diff-on-failure

Describe alternatives you've considered
N/A

Additional context
This has not been done yet because there are currently around 100 MyPy errors to work through first. Otherwise, every CI test would be marked as a failure for a fair while and spam my email about them. Therefore, this should only be implemented once all MyPy errors have been fixed.

@rlaphoenix rlaphoenix added the enhancement New feature or request label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant