summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-07 20:52:36 +0100
committerGitHub <noreply@github.com>2021-12-07 20:52:36 +0100
commit1c33080cf161481baada2afa2710b31675711285 (patch)
tree04bb910ec19d26de826acbafe48b3d1927779c8f
parentab841b8c63183ca20b866818ab2f930a5643ba5f (diff)
parentf40e9b3517607c95f2ce2735e3b08ffde8d61e5a (diff)
downloadgitlab-1c33080cf161481baada2afa2710b31675711285.tar.gz
Merge pull request #1727 from python-gitlab/jlvillal/mypy_strict_two_steps
Enable more strict mypy checking
-rw-r--r--gitlab/v4/objects/keys.py2
-rw-r--r--pyproject.toml18
2 files changed, 18 insertions, 2 deletions
diff --git a/gitlab/v4/objects/keys.py b/gitlab/v4/objects/keys.py
index 46f6894..c03dced 100644
--- a/gitlab/v4/objects/keys.py
+++ b/gitlab/v4/objects/keys.py
@@ -31,4 +31,4 @@ class KeyManager(GetMixin, RESTManager):
server_data = self.gitlab.http_get(self.path, **kwargs)
if TYPE_CHECKING:
assert isinstance(server_data, dict)
- return cast(Key, self._obj_cls(self, server_data))
+ return self._obj_cls(self, server_data)
diff --git a/pyproject.toml b/pyproject.toml
index 3e81169..62e0bfb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,9 +4,25 @@ multi_line_output = 3
order_by_type = false
[tool.mypy]
+files = "."
+
+# 'strict = true' is equivalent to the following:
+check_untyped_defs = true
disallow_incomplete_defs = true
+disallow_subclassing_any = true
+disallow_untyped_decorators = true
disallow_untyped_defs = true
-files = "."
+warn_redundant_casts = true
+warn_unused_configs = true
+warn_unused_ignores = true
+
+# The following need to have changes made to be able to enable them:
+# disallow_any_generics = true
+# disallow_untyped_calls = true
+# no_implicit_optional = true
+# no_implicit_reexport = true
+# strict_equality = true
+# warn_return_any = true
[[tool.mypy.overrides]] # Overrides for currently untyped modules
module = [