diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-08-01 12:04:03 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2021-08-22 22:25:14 -0700 |
commit | bd50df6b963af39b70ea2db50fb2f30b55ddc196 (patch) | |
tree | ef64050d6324809d7792ec8b1a47db9c7c85e2cb | |
parent | 8e27721554af417623bfe13a2b76710a61fca44d (diff) | |
download | gitlab-bd50df6b963af39b70ea2db50fb2f30b55ddc196.tar.gz |
chore: fix mypy pre-commit hook
-rw-r--r-- | .mypy.ini | 9 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 6 | ||||
-rw-r--r-- | docs/__init__.py | 0 | ||||
-rw-r--r-- | pyproject.toml | 22 | ||||
-rw-r--r-- | tests/__init__.py | 0 | ||||
-rw-r--r-- | tests/functional/__init__.py | 0 | ||||
-rw-r--r-- | tests/functional/api/__init__.py | 0 | ||||
-rw-r--r-- | tests/functional/cli/__init__.py | 0 | ||||
-rw-r--r-- | tests/unit/mixins/__init__.py | 0 | ||||
-rw-r--r-- | tox.ini | 2 |
10 files changed, 28 insertions, 11 deletions
diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index fdc64de..0000000 --- a/.mypy.ini +++ /dev/null @@ -1,9 +0,0 @@ -[mypy] -files = gitlab/*.py,gitlab/v4/cli.py,gitlab/v4/objects/projects.py - -# disallow_incomplete_defs: This flag reports an error whenever it encounters a -# partly annotated function definition. -disallow_incomplete_defs = True -# disallow_untyped_defs: This flag reports an error whenever it encounters a -# function without type annotations or with incomplete type annotations. -disallow_untyped_defs = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8aa69b5..34a33b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,10 @@ repos: hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v0.910 hooks: - id: mypy + additional_dependencies: + # todo: sync with pip deps via renovate regex manager + - types-PyYAML==5.4.3 + - types-requests==2.25.1 diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/docs/__init__.py diff --git a/pyproject.toml b/pyproject.toml index 448a4e3..0cd4c1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,28 @@ profile = "black" multi_line_output = 3 order_by_type = false +[tool.mypy] +disallow_incomplete_defs = true +disallow_untyped_defs = true + +[[tool.mypy.overrides]] # Overrides for currently untyped modules +module = [ + "docs.*", + "docs.ext.*", + "gitlab.v4.objects.*", + "setup", + "tests.functional.*", + "tests.functional.api.*", + "tests.unit.*" +] +ignore_errors = true + +[[tool.mypy.overrides]] # Overrides to negate above patterns +module = [ + "gitlab.v4.objects.projects" +] +ignore_errors = false + [tool.semantic_release] version_variable = "gitlab/__version__.py:__version__" commit_subject = "chore: release v{version}" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/__init__.py diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/functional/__init__.py diff --git a/tests/functional/api/__init__.py b/tests/functional/api/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/functional/api/__init__.py diff --git a/tests/functional/cli/__init__.py b/tests/functional/cli/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/functional/cli/__init__.py diff --git a/tests/unit/mixins/__init__.py b/tests/unit/mixins/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/unit/mixins/__init__.py @@ -41,7 +41,7 @@ basepython = python3 envdir={toxworkdir}/lint deps = -r{toxinidir}/requirements-lint.txt commands = - mypy {posargs} + mypy {posargs} . [testenv:twine-check] basepython = python3 |