Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ repos:
rev: v0.812
hooks:
- id: mypy
# Copied from setup.cfg
exclude: "properties|asv_bench"
Copy link
Member

@andersy005 andersy005 Apr 12, 2021

Choose a reason for hiding this comment

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

Now that setup.cfg has

[mypy]
exclude = properties|asv_bench|doc

do we still need this exclude option here? It's my understanding that mypy pre-commit hook should be able to retrieve values defined in setup.cfg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We do, unfortunately.

I guess that pre-commit gives it a list of files, and when passed a list of files mypy doesn't honor the exclusions.

# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
# - repo: https://github.com/asottile/pyupgrade
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ default_section = THIRDPARTY
known_first_party = xarray

[mypy]
exclude = properties|asv_bench|doc
files = xarray/**/*.py
show_error_codes = True

# Most of the numerical computing stack doesn't have type annotations yet.
Expand Down Expand Up @@ -238,7 +240,6 @@ ignore_missing_imports = True
[mypy-xarray.core.pycompat]
ignore_errors = True


[aliases]
test = pytest

Expand Down