mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Enable mypy disallow_untyped_defs (#2609)
This commit is contained in:
@@ -129,6 +129,7 @@ import typing
|
||||
import urllib.parse
|
||||
from base64 import b64encode
|
||||
from datetime import date, datetime, timezone
|
||||
from typing import Any, Dict
|
||||
|
||||
from deprecated import deprecated
|
||||
|
||||
@@ -202,7 +203,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
This class represents Repositories. The reference can be found here https://docs.github.com/en/rest/reference/repos
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"full_name": self._full_name.value})
|
||||
|
||||
@property
|
||||
@@ -3826,7 +3827,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck("DELETE", f"{self.url}/environments/{environment_name}")
|
||||
|
||||
def _initAttributes(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._allow_auto_merge = github.GithubObject.NotSet
|
||||
self._allow_forking = github.GithubObject.NotSet
|
||||
self._allow_merge_commit = github.GithubObject.NotSet
|
||||
@@ -3915,7 +3916,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
self._watchers = github.GithubObject.NotSet
|
||||
self._watchers_count = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "allow_auto_merge" in attributes: # pragma no branch
|
||||
self._allow_auto_merge = self._makeBoolAttribute(attributes["allow_auto_merge"])
|
||||
if "allow_forking" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user