diff --git a/.isort.cfg b/.isort.cfg index 1d0b21cf..1567719e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -6,4 +6,11 @@ force_grid_wrap=0 use_parentheses=True line_length=88 ensure_newline_before_comments=True -extend_skip_glob=tests/*.py,docs/*.py,setup.py \ No newline at end of file +extend_skip_glob=tests/*.py,docs/conf.py,setup.py,pyvistaqt/rwi.py +# `pre-comment` doesn't see skips; `filter_files=True` forces it +# to see these files +# +# See: +# - https://jugmac00.github.io/blog/isort-and-pre-commit-a-friendship-with-obstacles/ +# - https://github.com/PyCQA/isort/issues/885 +filter_files=True \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ca196e1..25df71d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,16 @@ repos: rev: v0.961 hooks: - id: mypy + language: system + # `pass_filenames` is used to overcome the "duplicate module" + # error from occuring. We are explicitly passing a 'txt' + # file to search. This setting tells `pre-commit` to not do a + # search and pass files to check to mypy, like it normally does. + # + # See: + # - https://github.com/python/mypy/issues/4008#issuecomment-708060733 + # - https://pre-commit.com/#hooks-pass_filenames + pass_filenames: false args: [ "--config-file", "mypy.ini", diff --git a/pyproject.toml b/pyproject.toml index 44e98c73..7b6367c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,19 @@ line-length = 88 skip-string-normalization = true target-version = ["py39"] -exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules|rwi\.py' +# `pre-comment` doesn't see skips; `force-exclude` forces it +# to see these files +# +# See: +# - https://github.com/psf/black/issues/1584 +force-exclude = ''' +( + docs/conf\.py + | pyvistaqt/rwi\.py + | tests/.*\.py + | setup.py +) +''' check = true [tool.pydocstyle]