summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-08-01 09:57:51 +0200
committerGitHub <noreply@github.com>2022-08-01 09:57:51 +0200
commit1c91b24dac47b82f4621566fad4933b999d1503c (patch)
tree1521fc3dd0841ae7e136f9f30dec8b2f1d3604bb
parentd81cec36136d8425767adaa144abfc513fcb8285 (diff)
parent64b208e0e91540af2b645da595f0ef79ee7522e1 (diff)
downloadgitlab-1c91b24dac47b82f4621566fad4933b999d1503c.tar.gz
Merge pull request #2210 from python-gitlab/jlvillal/mypy_step_by_step
chore: enable mypy check `no_implicit_optional`
-rw-r--r--gitlab/v4/objects/appearance.py2
-rw-r--r--gitlab/v4/objects/repositories.py2
-rw-r--r--gitlab/v4/objects/settings.py2
-rw-r--r--pyproject.toml2
4 files changed, 4 insertions, 4 deletions
diff --git a/gitlab/v4/objects/appearance.py b/gitlab/v4/objects/appearance.py
index 88ab621..f811d20 100644
--- a/gitlab/v4/objects/appearance.py
+++ b/gitlab/v4/objects/appearance.py
@@ -38,7 +38,7 @@ class ApplicationAppearanceManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
def update(
self,
id: Optional[Union[str, int]] = None,
- new_data: Dict[str, Any] = None,
+ new_data: Optional[Dict[str, Any]] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""Update an object on the server.
diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py
index b8dbdd8..b340e80 100644
--- a/gitlab/v4/objects/repositories.py
+++ b/gitlab/v4/objects/repositories.py
@@ -196,7 +196,7 @@ class RepositoryMixin(_RestObjectBase):
@exc.on_http_error(exc.GitlabListError)
def repository_archive(
self,
- sha: str = None,
+ sha: Optional[str] = None,
streamed: bool = False,
action: Optional[Callable[..., Any]] = None,
chunk_size: int = 1024,
diff --git a/gitlab/v4/objects/settings.py b/gitlab/v4/objects/settings.py
index 16b1041..cc6b1c0 100644
--- a/gitlab/v4/objects/settings.py
+++ b/gitlab/v4/objects/settings.py
@@ -93,7 +93,7 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
def update(
self,
id: Optional[Union[str, int]] = None,
- new_data: Dict[str, Any] = None,
+ new_data: Optional[Dict[str, Any]] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""Update an object on the server.
diff --git a/pyproject.toml b/pyproject.toml
index 544543b..a8b0220 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -13,6 +13,7 @@ disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
+no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
@@ -23,7 +24,6 @@ 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
[[tool.mypy.overrides]] # Overrides for currently untyped modules
module = [