mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Set line length to 120 characters (#2599)
This commit is contained in:
@@ -48,9 +48,7 @@ class SimpleAdvisoryVulnerability(TypedDict):
|
||||
vulnerable_version_range: NotRequired[Optional[str]]
|
||||
|
||||
|
||||
AdvisoryVulnerability = Union[
|
||||
SimpleAdvisoryVulnerability, "RepositoryAdvisoryVulnerability"
|
||||
]
|
||||
AdvisoryVulnerability = Union[SimpleAdvisoryVulnerability, "RepositoryAdvisoryVulnerability"]
|
||||
|
||||
|
||||
class RepositoryAdvisoryVulnerability(github.GithubObject.NonCompletableGithubObject):
|
||||
@@ -104,17 +102,11 @@ class RepositoryAdvisoryVulnerability(github.GithubObject.NonCompletableGithubOb
|
||||
attributes["package"],
|
||||
)
|
||||
if "patched_versions" in attributes: # pragma no branch
|
||||
self._patched_versions = self._makeStringAttribute(
|
||||
attributes["patched_versions"]
|
||||
)
|
||||
self._patched_versions = self._makeStringAttribute(attributes["patched_versions"])
|
||||
if "vulnerable_functions" in attributes: # pragma no branch
|
||||
self._vulnerable_functions = self._makeListOfStringsAttribute(
|
||||
attributes["vulnerable_functions"]
|
||||
)
|
||||
self._vulnerable_functions = self._makeListOfStringsAttribute(attributes["vulnerable_functions"])
|
||||
if "vulnerable_version_range" in attributes: # pragma no branch
|
||||
self._vulnerable_version_range = self._makeStringAttribute(
|
||||
attributes["vulnerable_version_range"]
|
||||
)
|
||||
self._vulnerable_version_range = self._makeStringAttribute(attributes["vulnerable_version_range"])
|
||||
|
||||
@classmethod
|
||||
def _validate_vulnerability(cls, vulnerability: AdvisoryVulnerability) -> None:
|
||||
@@ -128,13 +120,9 @@ class RepositoryAdvisoryVulnerability(github.GithubObject.NonCompletableGithubOb
|
||||
assert "name" in package, package
|
||||
assert isinstance(package["name"], (str, type(None))), package
|
||||
assert "patched_versions" in vulnerability, vulnerability
|
||||
assert isinstance(
|
||||
vulnerability["patched_versions"], (str, type(None))
|
||||
), vulnerability
|
||||
assert isinstance(vulnerability["patched_versions"], (str, type(None))), vulnerability
|
||||
assert "vulnerable_functions" in vulnerability, vulnerability
|
||||
assert isinstance(
|
||||
vulnerability["vulnerable_functions"], (list, type(None))
|
||||
), vulnerability
|
||||
assert isinstance(vulnerability["vulnerable_functions"], (list, type(None))), vulnerability
|
||||
assert "vulnerable_functions" in vulnerability, vulnerability
|
||||
assert (
|
||||
all(isinstance(vf, str) for vf in vulnerability["vulnerable_functions"])
|
||||
@@ -142,9 +130,7 @@ class RepositoryAdvisoryVulnerability(github.GithubObject.NonCompletableGithubOb
|
||||
else True
|
||||
), vulnerability
|
||||
assert "vulnerable_version_range" in vulnerability, vulnerability
|
||||
assert isinstance(
|
||||
vulnerability["vulnerable_version_range"], (str, type(None))
|
||||
), vulnerability
|
||||
assert isinstance(vulnerability["vulnerable_version_range"], (str, type(None))), vulnerability
|
||||
|
||||
else:
|
||||
assert (
|
||||
@@ -157,9 +143,7 @@ class RepositoryAdvisoryVulnerability(github.GithubObject.NonCompletableGithubOb
|
||||
vulnerability: AdvisoryVulnerability,
|
||||
) -> SimpleAdvisoryVulnerability:
|
||||
if isinstance(vulnerability, dict):
|
||||
vulnerability_package: SimpleAdvisoryVulnerabilityPackage = vulnerability[
|
||||
"package"
|
||||
]
|
||||
vulnerability_package: SimpleAdvisoryVulnerabilityPackage = vulnerability["package"]
|
||||
return {
|
||||
"package": {
|
||||
"ecosystem": vulnerability_package["ecosystem"],
|
||||
|
||||
Reference in New Issue
Block a user