Enable mypy disallow_untyped_defs (#2609)

This commit is contained in:
Trim21
2023-07-14 21:47:24 +02:00
committed by GitHub
parent 8816889a7d
commit 294c0cc9c5
130 changed files with 597 additions and 412 deletions
+5 -3
View File
@@ -22,6 +22,8 @@
from __future__ import annotations
from typing import Any
import github.NamedUser
import github.Team
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
@@ -32,11 +34,11 @@ class EnvironmentProtectionRuleReviewer(NonCompletableGithubObject):
This class represents a reviewer for an EnvironmentProtectionRule. The reference can be found here https://docs.github.com/en/rest/reference/deployments#environments
"""
def _initAttributes(self):
def _initAttributes(self) -> None:
self._type: Attribute[str] = NotSet
self._reviewer: Attribute[github.NamedUser.NamedUser | github.Team.Team] = NotSet
def __repr__(self):
def __repr__(self) -> str:
return self.get__repr__({"type": self._type.value})
@property
@@ -47,7 +49,7 @@ class EnvironmentProtectionRuleReviewer(NonCompletableGithubObject):
def reviewer(self) -> github.NamedUser.NamedUser | github.Team.Team:
return self._reviewer.value
def _useAttributes(self, attributes):
def _useAttributes(self, attributes: dict[str, Any]) -> None:
if "type" in attributes: # pragma no branch
self._type = self._makeStringAttribute(attributes["type"])
if "reviewer" in attributes: # pragma no branch