Skip to content

Commit

Permalink
Merge pull request #1727 from python-gitlab/jlvillal/mypy_strict_two_…
Browse files Browse the repository at this point in the history
…steps

Enable more strict mypy checking
  • Loading branch information
nejch committed Dec 7, 2021
2 parents ab841b8 + f40e9b3 commit 1c33080
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gitlab/v4/objects/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ def get(
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)
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 1c33080

Please sign in to comment.