Skip to content

Commit 1c91b24

Browse files
authored
Merge pull request #2210 from python-gitlab/jlvillal/mypy_step_by_step
chore: enable mypy check `no_implicit_optional`
2 parents d81cec3 + 64b208e commit 1c91b24

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

gitlab/v4/objects/appearance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ApplicationAppearanceManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
3838
def update(
3939
self,
4040
id: Optional[Union[str, int]] = None,
41-
new_data: Dict[str, Any] = None,
41+
new_data: Optional[Dict[str, Any]] = None,
4242
**kwargs: Any
4343
) -> Dict[str, Any]:
4444
"""Update an object on the server.

gitlab/v4/objects/repositories.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def repository_contributors(
196196
@exc.on_http_error(exc.GitlabListError)
197197
def repository_archive(
198198
self,
199-
sha: str = None,
199+
sha: Optional[str] = None,
200200
streamed: bool = False,
201201
action: Optional[Callable[..., Any]] = None,
202202
chunk_size: int = 1024,

gitlab/v4/objects/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ApplicationSettingsManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
9393
def update(
9494
self,
9595
id: Optional[Union[str, int]] = None,
96-
new_data: Dict[str, Any] = None,
96+
new_data: Optional[Dict[str, Any]] = None,
9797
**kwargs: Any
9898
) -> Dict[str, Any]:
9999
"""Update an object on the server.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ disallow_incomplete_defs = true
1313
disallow_subclassing_any = true
1414
disallow_untyped_decorators = true
1515
disallow_untyped_defs = true
16+
no_implicit_optional = true
1617
no_implicit_reexport = true
1718
strict_equality = true
1819
warn_redundant_casts = true
@@ -23,7 +24,6 @@ warn_unused_ignores = true
2324
# The following need to have changes made to be able to enable them:
2425
# disallow_any_generics = true
2526
# disallow_untyped_calls = true
26-
# no_implicit_optional = true
2727

2828
[[tool.mypy.overrides]] # Overrides for currently untyped modules
2929
module = [

0 commit comments

Comments
 (0)