mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Enable mypy disallow_untyped_defs (#2609)
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.GithubObject
|
||||
|
||||
|
||||
@@ -41,7 +43,7 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject):
|
||||
This class represents RepositoryKeys. The reference can be found here https://docs.github.com/en/rest/reference/repos#deploy-keys
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"id": self._id.value, "title": self._title.value})
|
||||
|
||||
@property
|
||||
@@ -107,7 +109,7 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject):
|
||||
"""
|
||||
headers, data = self._requester.requestJsonAndCheck("DELETE", self.url)
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._created_at = github.GithubObject.NotSet
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._key = github.GithubObject.NotSet
|
||||
@@ -116,7 +118,7 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject):
|
||||
self._verified = github.GithubObject.NotSet
|
||||
self._read_only = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "created_at" in attributes: # pragma no branch
|
||||
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
||||
if "id" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user