Skip to content

Commit

Permalink
Formatting & make linter happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
alson committed May 31, 2023
1 parent 1bcd1e2 commit 6f5c026
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
9 changes: 6 additions & 3 deletions github/Environment.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import github.GithubObject
import github.EnvironmentProtectionRule
import github.EnvironmentDeploymentBranchPolicy


class Environment(github.GithubObject.CompletableGithubObject):
@property
def created_at(self) -> datetime.datetime: ...
Expand All @@ -17,10 +16,14 @@ class Environment(github.GithubObject.CompletableGithubObject):
@property
def node_id(self) -> str: ...
@property
def protection_rules(self) -> List[github.EnvironmentProtectionRule.EnvironmentProtectionRule]: ...
def protection_rules(
self,
) -> List[github.EnvironmentProtectionRule.EnvironmentProtectionRule]: ...
@property
def updated_at(self) -> datetime.datetime: ...
@property
def url(self) -> str: ...
@property
def deployment_branch_policy(self) -> github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicy
def deployment_branch_policy(
self,
) -> github.EnvironmentDeploymentBranchPolicy.EnvironmentDeploymentBranchPolicy: ...
6 changes: 3 additions & 3 deletions github/EnvironmentDeploymentBranchPolicy.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import github.GithubObject
import github.EnvironmentProtectionRuleReviewer


class EnvironmentDeploymentBranchPolicy(github.GithubObject.CompletableGithubObject):
@property
def protected_branches(self) -> bool: ...
@property
def custom_branch_policies(self) -> bool: ...


class EnvironmentDeploymentBranchPolicyParams:
def __init__(self, protected_branches: bool=..., custom_branch_policies: bool=...): ...
def __init__(
self, protected_branches: bool = ..., custom_branch_policies: bool = ...
): ...
def _asdict(self) -> dict: ...
7 changes: 5 additions & 2 deletions github/EnvironmentProtectionRule.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ from typing import List
import github.GithubObject
import github.EnvironmentProtectionRuleReviewer


class EnvironmentProtectionRule(github.GithubObject.CompletableGithubObject):
@property
def id(self) -> int: ...
Expand All @@ -11,6 +10,10 @@ class EnvironmentProtectionRule(github.GithubObject.CompletableGithubObject):
@property
def type(self) -> str: ...
@property
def reviewers(self) -> List[github.EnvironmentProtectionRuleReviewer.EnvironmentProtectionRuleReviewer]: ...
def reviewers(
self,
) -> List[
github.EnvironmentProtectionRuleReviewer.EnvironmentProtectionRuleReviewer
]: ...
@property
def wait_timer(self) -> int: ...
2 changes: 0 additions & 2 deletions github/EnvironmentProtectionRuleReviewer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import github.GithubObject
import github.NamedUser
import github.Team


class EnvironmentProtectionRuleReviewer(github.GithubObject.NonCompletableGithubObject):
@property
def type(self) -> str: ...
@property
def reviewer(self) -> Union[github.NamedUser.NamedUser, github.Team.Team]: ...


class ReviewerParams:
def __init__(self, type_: str, id_: int): ...
def _asdict(self) -> dict: ...
12 changes: 9 additions & 3 deletions github/Repository.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ from github.ContentFile import ContentFile
from github.Deployment import Deployment
from github.Download import Download
from github.Environment import Environment
from github.EnvironmentDeploymentBranchPolicy import EnvironmentDeploymentBranchPolicyParams
from github.EnvironmentDeploymentBranchPolicy import (
EnvironmentDeploymentBranchPolicyParams,
)
from github.EnvironmentProtectionRuleReviewer import ReviewerParams
from github.Event import Event
from github.GitBlob import GitBlob
Expand Down Expand Up @@ -142,7 +144,9 @@ class Repository(CompletableGithubObject):
environment_name: str,
wait_timer: int = ...,
reviewers: List[ReviewerParams] = ...,
deployment_branch_policy: Optional[EnvironmentDeploymentBranchPolicyParams] = ...,
deployment_branch_policy: Optional[
EnvironmentDeploymentBranchPolicyParams
] = ...,
) -> Environment: ...
def create_file(
self,
Expand Down Expand Up @@ -632,7 +636,9 @@ class Repository(CompletableGithubObject):
environment_name: str,
wait_timer: int = ...,
reviewers: List[ReviewerParams] = ...,
deployment_branch_policy: Optional[EnvironmentDeploymentBranchPolicyParams] = ...,
deployment_branch_policy: Optional[
EnvironmentDeploymentBranchPolicyParams
] = ...,
) -> Environment: ...
def update_file(
self,
Expand Down
2 changes: 1 addition & 1 deletion tests/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import datetime

import pytest
import pytest # type: ignore

import github
import github.EnvironmentDeploymentBranchPolicy
Expand Down

0 comments on commit 6f5c026

Please sign in to comment.