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.CodeScanAlertInstance
|
||||
import github.CodeScanRule
|
||||
import github.CodeScanTool
|
||||
@@ -34,7 +36,7 @@ class CodeScanAlert(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__({"number": self.number})
|
||||
|
||||
@property
|
||||
@@ -133,7 +135,7 @@ class CodeScanAlert(github.GithubObject.NonCompletableGithubObject):
|
||||
None,
|
||||
)
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._number = github.GithubObject.NotSet
|
||||
self._rule = github.GithubObject.NotSet
|
||||
self._tool = github.GithubObject.NotSet
|
||||
@@ -150,7 +152,7 @@ class CodeScanAlert(github.GithubObject.NonCompletableGithubObject):
|
||||
self._most_recent_instance = github.GithubObject.NotSet
|
||||
self._state = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "number" in attributes: # pragma no branch
|
||||
self._number = self._makeIntAttribute(attributes["number"])
|
||||
if "rule" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user