Enable mypy disallow_untyped_defs (#2609)

This commit is contained in:
Trim21
2023-07-14 21:47:24 +02:00
committed by GitHub
parent 8816889a7d
commit 294c0cc9c5
130 changed files with 597 additions and 412 deletions
+4 -3
View File
@@ -129,6 +129,7 @@ import typing
import urllib.parse
from base64 import b64encode
from datetime import date, datetime, timezone
from typing import Any, Dict
from deprecated import deprecated
@@ -202,7 +203,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
This class represents Repositories. The reference can be found here https://docs.github.com/en/rest/reference/repos
"""
def __repr__(self):
def __repr__(self) -> str:
return self.get__repr__({"full_name": self._full_name.value})
@property
@@ -3826,7 +3827,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
headers, data = self._requester.requestJsonAndCheck("DELETE", f"{self.url}/environments/{environment_name}")
def _initAttributes(self):
def _initAttributes(self) -> None:
self._allow_auto_merge = github.GithubObject.NotSet
self._allow_forking = github.GithubObject.NotSet
self._allow_merge_commit = github.GithubObject.NotSet
@@ -3915,7 +3916,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
self._watchers = github.GithubObject.NotSet
self._watchers_count = github.GithubObject.NotSet
def _useAttributes(self, attributes):
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "allow_auto_merge" in attributes: # pragma no branch
self._allow_auto_merge = self._makeBoolAttribute(attributes["allow_auto_merge"])
if "allow_forking" in attributes: # pragma no branch