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:
@@ -20,6 +20,8 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.CodeScanAlertInstanceLocation
|
||||
import github.GithubObject
|
||||
|
||||
@@ -30,7 +32,7 @@ class CodeScanAlertInstance(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__({"ref": self.ref, "analysis_key": self.analysis_key})
|
||||
|
||||
@property
|
||||
@@ -89,7 +91,7 @@ class CodeScanAlertInstance(github.GithubObject.NonCompletableGithubObject):
|
||||
"""
|
||||
return self._classifications.value
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._ref = github.GithubObject.NotSet
|
||||
self._analysis_key = github.GithubObject.NotSet
|
||||
self._environment = github.GithubObject.NotSet
|
||||
@@ -99,7 +101,7 @@ class CodeScanAlertInstance(github.GithubObject.NonCompletableGithubObject):
|
||||
self._location = github.GithubObject.NotSet
|
||||
self._classifications = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "ref" in attributes: # pragma no branch
|
||||
self._ref = self._makeStringAttribute(attributes["ref"])
|
||||
if "analysis_key" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user