Skip to content

BLD: More lightweight mypy pre-commit hook #30814

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

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ repos:
rev: v0.730
hooks:
- id: mypy
# We run mypy over all files because of:
# * changes in type definitions may affect non-touched files.
# * Running it with `mypy pandas` and the filenames will lead to
# spurious duplicate module errors,
# see also https://github.com/pre-commit/mirrors-mypy/issues/5
pass_filenames: false
args:
- pandas
# As long as a some files are excluded from check-untyped-defs
# we have to exclude it from the pre-commit hook as the configuration
# is based on modules but the hook runs on files.
- --no-check-untyped-defs
Copy link
Member

Choose a reason for hiding this comment

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

I would have a slight preference to remove altogether rather than using different defaults that what's in CI

Copy link
Member

@gfyoung gfyoung Jan 8, 2020

Choose a reason for hiding this comment

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

IMO it's better to do a partial mypy check than none at all as you're making changes.

In our PR checklist, we can then ask that people do a full mypy pandas check before submitting so that they can catch any other errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given that there has been good progress in getting all untyped defs to pass, I expect this to only be a short-lived workaround.

- --follow-imports
- skip
files: pandas/