mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Enable mypy disallow_untyped_defs (#2609)
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.GithubObject
|
||||
|
||||
|
||||
@@ -29,7 +31,7 @@ class CodeScanRule(github.GithubObject.NonCompletableGithubObject):
|
||||
The reference can be found here https://docs.github.com/en/rest/reference/code-scanning.
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"id": self.id, "name": self.name})
|
||||
|
||||
@property
|
||||
@@ -67,14 +69,14 @@ class CodeScanRule(github.GithubObject.NonCompletableGithubObject):
|
||||
"""
|
||||
return self._description.value
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._name = github.GithubObject.NotSet
|
||||
self._severity = github.GithubObject.NotSet
|
||||
self._security_severity_level = github.GithubObject.NotSet
|
||||
self._description = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "id" in attributes: # pragma no branch
|
||||
self._id = self._makeStringAttribute(attributes["id"])
|
||||
if "name" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user