mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Format with new black (#1679)
Black is very opinionated, but sometimes those opinions change. Run the new black version across the codebase, and lock down the version used by pre-commit so we don't get surprised like this again.
This commit is contained in:
@@ -479,7 +479,10 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
|
||||
else:
|
||||
request_header = None
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"POST", "/authorizations", input=post_parameters, headers=request_header,
|
||||
"POST",
|
||||
"/authorizations",
|
||||
input=post_parameters,
|
||||
headers=request_header,
|
||||
)
|
||||
return github.Authorization.Authorization(
|
||||
self._requester, headers, data, completed=True
|
||||
|
||||
+4
-3
@@ -163,7 +163,7 @@ class Branch(github.GithubObject.NonCompletableGithubObject):
|
||||
assert (
|
||||
required_approving_review_count is github.GithubObject.NotSet
|
||||
or isinstance(required_approving_review_count, int)
|
||||
), required_approving_review_count
|
||||
), (required_approving_review_count)
|
||||
|
||||
post_parameters = {}
|
||||
if (
|
||||
@@ -250,7 +250,8 @@ class Branch(github.GithubObject.NonCompletableGithubObject):
|
||||
:calls: `DELETE /repos/:owner/:repo/branches/:branch/protection <https://developer.github.com/v3/repos/branches>`_
|
||||
"""
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"DELETE", self.protection_url,
|
||||
"DELETE",
|
||||
self.protection_url,
|
||||
)
|
||||
|
||||
def get_required_status_checks(self):
|
||||
@@ -342,7 +343,7 @@ class Branch(github.GithubObject.NonCompletableGithubObject):
|
||||
assert (
|
||||
required_approving_review_count is github.GithubObject.NotSet
|
||||
or isinstance(required_approving_review_count, int)
|
||||
), required_approving_review_count
|
||||
), (required_approving_review_count)
|
||||
|
||||
post_parameters = {}
|
||||
if dismissal_users is not github.GithubObject.NotSet:
|
||||
|
||||
@@ -194,7 +194,9 @@ class Deployment(github.GithubObject.CompletableGithubObject):
|
||||
if description is not github.GithubObject.NotSet:
|
||||
post_parameters["description"] = description
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"POST", self.url + "/statuses", input=post_parameters,
|
||||
"POST",
|
||||
self.url + "/statuses",
|
||||
input=post_parameters,
|
||||
)
|
||||
return github.DeploymentStatus.DeploymentStatus(
|
||||
self._requester, headers, data, completed=True
|
||||
|
||||
@@ -118,7 +118,10 @@ class Notification(github.GithubObject.CompletableGithubObject):
|
||||
"""
|
||||
:calls: `PATCH /notifications/threads/:id <https://developer.github.com/v3/activity/notifications/>`_
|
||||
"""
|
||||
headers, data = self._requester.requestJsonAndCheck("PATCH", self.url,)
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PATCH",
|
||||
self.url,
|
||||
)
|
||||
|
||||
def get_pull_request(self):
|
||||
"""
|
||||
|
||||
@@ -168,7 +168,9 @@ class ProjectCard(github.GithubObject.CompletableGithubObject):
|
||||
:rtype: bool
|
||||
"""
|
||||
status, _, _ = self._requester.requestJson(
|
||||
"DELETE", self.url, headers={"Accept": Consts.mediaTypeProjectsPreview},
|
||||
"DELETE",
|
||||
self.url,
|
||||
headers={"Accept": Consts.mediaTypeProjectsPreview},
|
||||
)
|
||||
return status == 204
|
||||
|
||||
|
||||
@@ -170,7 +170,9 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject):
|
||||
:rtype: bool
|
||||
"""
|
||||
status, _, _ = self._requester.requestJson(
|
||||
"DELETE", self.url, headers={"Accept": Consts.mediaTypeProjectsPreview},
|
||||
"DELETE",
|
||||
self.url,
|
||||
headers={"Accept": Consts.mediaTypeProjectsPreview},
|
||||
)
|
||||
return status == 204
|
||||
|
||||
|
||||
@@ -713,7 +713,8 @@ class PullRequest(github.GithubObject.CompletableGithubObject):
|
||||
"""
|
||||
assert isinstance(id, int), id
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET", self.url + "/reviews/" + str(id),
|
||||
"GET",
|
||||
self.url + "/reviews/" + str(id),
|
||||
)
|
||||
return github.PullRequestReview.PullRequestReview(
|
||||
self._requester, headers, data, completed=True
|
||||
|
||||
+11
-4
@@ -844,7 +844,8 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
if isinstance(collaborator, github.NamedUser.NamedUser):
|
||||
collaborator = collaborator._identity
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET", self.url + "/collaborators/" + collaborator + "/permission",
|
||||
"GET",
|
||||
self.url + "/collaborators/" + collaborator + "/permission",
|
||||
)
|
||||
return data["permission"]
|
||||
|
||||
@@ -1876,7 +1877,9 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
if description is not github.GithubObject.NotSet:
|
||||
post_parameters["description"] = description
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"POST", self.url + "/deployments", input=post_parameters,
|
||||
"POST",
|
||||
self.url + "/deployments",
|
||||
input=post_parameters,
|
||||
)
|
||||
return github.Deployment.Deployment(
|
||||
self._requester, headers, data, completed=True
|
||||
@@ -2245,7 +2248,9 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
if organization is not github.GithubObject.NotSet:
|
||||
post_parameters["organization"] = organization
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"POST", self.url + "/forks", input=post_parameters,
|
||||
"POST",
|
||||
self.url + "/forks",
|
||||
input=post_parameters,
|
||||
)
|
||||
return Repository(self._requester, headers, data, completed=True)
|
||||
|
||||
@@ -2790,7 +2795,9 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"""
|
||||
import_header = {"Accept": Consts.mediaTypeImportPreview}
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET", self.url + "/import", headers=import_header,
|
||||
"GET",
|
||||
self.url + "/import",
|
||||
headers=import_header,
|
||||
)
|
||||
if not data:
|
||||
return None
|
||||
|
||||
+4
-1
@@ -319,7 +319,10 @@ class Team(github.GithubObject.CompletableGithubObject):
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
|
||||
"""
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.Team.Team, self._requester, self.url + "/teams", None,
|
||||
github.Team.Team,
|
||||
self._requester,
|
||||
self.url + "/teams",
|
||||
None,
|
||||
)
|
||||
|
||||
def get_discussions(self):
|
||||
|
||||
Reference in New Issue
Block a user