Skip to content

Commit 2b27932

Browse files
committed
Fixed lint errors.
1 parent 42b6300 commit 2b27932

7 files changed

Lines changed: 35 additions & 27 deletions

File tree

github_deploy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

github_deploy/commands/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

github_deploy/commands/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ def get_repo(*, org, project):
33

44

55
def can_upload(*, repo, include_private):
6-
return True if include_private and repo['private'] == True else not repo['private']
6+
return True if include_private and repo["private"] == True else not repo["private"]

github_deploy/commands/delete.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ async def check_exists(*, session, repo, dest, token, semaphore, skip_missing):
8080
return response
8181

8282

83-
async def handle_file_delete(
84-
*, repo, dest, token, semaphore, session
85-
):
83+
async def handle_file_delete(*, repo, dest, token, semaphore, session):
8684
check_exists_response = await check_exists(
8785
session=session,
8886
repo=repo,
@@ -114,7 +112,7 @@ async def handle_file_delete(
114112
exists=exists,
115113
current_sha=current_sha,
116114
)
117-
115+
118116
if delete_response:
119117
return click.style(
120118
"Successfully deleted contents at {repo}/{dest}".format(
@@ -124,7 +122,7 @@ async def handle_file_delete(
124122
fg="green",
125123
bold=True,
126124
)
127-
125+
128126
return click.style(
129127
"No content found at {repo}/{dest}".format(repo=repo, dest=dest),
130128
fg="blue",
@@ -154,7 +152,7 @@ async def list_repos(*, session, org, token):
154152
prompt=click.style("Enter your personal access token", bold=True),
155153
help="Personal Access token with read and write access to org.",
156154
hide_input=True,
157-
envvar='TOKEN',
155+
envvar="TOKEN",
158156
)
159157
@click.option(
160158
"--dest",
@@ -182,7 +180,11 @@ async def main(org, token, dest):
182180
fg="green",
183181
)
184182
)
185-
click.echo(click.style('Deleting "{path}" for all repositories:'.format(path=dest), fg="blue"))
183+
click.echo(
184+
click.style(
185+
'Deleting "{path}" for all repositories:'.format(path=dest), fg="blue"
186+
)
187+
)
186188
click.echo("\n".join(repos))
187189

188190
c = click.prompt(click.style("Continue? [YN] ", fg="blue"))

github_deploy/commands/upload.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def handle_file_upload(
120120
path=dest,
121121
),
122122
fg="blue",
123-
bold=True
123+
bold=True,
124124
)
125125

126126
else:
@@ -154,7 +154,7 @@ async def handle_file_upload(
154154
dest=upload_response["content"]["path"],
155155
),
156156
fg="green",
157-
bold=True
157+
bold=True,
158158
)
159159

160160

@@ -180,7 +180,7 @@ async def list_repos(*, session, org, token):
180180
prompt=click.style("Enter your personal access token", bold=True),
181181
help="Personal Access token with read and write access to org.",
182182
hide_input=True,
183-
envvar='TOKEN',
183+
envvar="TOKEN",
184184
)
185185
@click.option(
186186
"--source",
@@ -219,10 +219,12 @@ async def main(org, token, source, dest, overwrite, private):
219219
for r in response["items"]
220220
if not r["archived"] and can_upload(repo=r, include_private=private)
221221
]
222-
repo_type = 'public and private' if private else 'public'
222+
repo_type = "public and private" if private else "public"
223223
click.echo(
224224
click.style(
225-
"Found '{}' repositories non archived {} repositories:".format(len(repos), repo_type),
225+
"Found '{}' repositories non archived {} repositories:".format(
226+
len(repos), repo_type
227+
),
226228
fg="green",
227229
)
228230
)
@@ -238,11 +240,12 @@ async def main(org, token, source, dest, overwrite, private):
238240
)
239241
)
240242
deploy_msg = (
241-
'Deploying "{source}" to "{path}" for all repositories'.format(source=source, path=dest)
243+
'Deploying "{source}" to "{path}" for all repositories'.format(
244+
source=source, path=dest
245+
)
242246
if overwrite
243247
else 'Deploying "{source}" to repositories that don\'t already have contents at "{path}"'.format(
244-
source=source,
245-
path=dest
248+
source=source, path=dest
246249
)
247250
)
248251
click.echo(click.style(deploy_msg, fg="blue"))

github_deploy/main.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
import asyncclick as click
22
import os
33

4-
plugin_folder = os.path.join(os.path.dirname(__file__), 'commands')
4+
plugin_folder = os.path.join(os.path.dirname(__file__), "commands")
55

66

77
class GithubDeploy(click.MultiCommand):
8-
98
def list_commands(self, ctx):
109
rv = []
1110
for filename in os.listdir(plugin_folder):
12-
if filename.endswith('.py') and not filename.startswith('__init__') and not filename.startswith('_'):
11+
if (
12+
filename.endswith(".py")
13+
and not filename.startswith("__init__")
14+
and not filename.startswith("_")
15+
):
1316
rv.append(filename[:-3])
1417
rv.sort()
1518
return rv
1619

1720
def get_command(self, ctx, name):
1821
ns = {}
19-
fn = os.path.join(plugin_folder, name + '.py')
22+
fn = os.path.join(plugin_folder, name + ".py")
2023

2124
if os.path.exists(fn):
2225
with open(fn) as f:
23-
code = compile(f.read(), fn, 'exec')
26+
code = compile(f.read(), fn, "exec")
2427
eval(code, ns, ns)
25-
return ns['main']
28+
return ns["main"]
2629

2730
ctx.fail("Invalid Command: {name}".format(name=name))
2831

2932

3033
main = GithubDeploy(
31-
help='Deploy changes to multiple github repositories using a single command.',
34+
help="Deploy changes to multiple github repositories using a single command.",
3235
)
3336

34-
if __name__ == '__main__':
37+
if __name__ == "__main__":
3538
main()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
author_email="jtonye@ymail.com",
4040
license="MIT",
4141
packages=find_packages(),
42-
python_requires='>=3.6',
42+
python_requires=">=3.6",
4343
extras_require=extras_require,
4444
install_requires=[
4545
"asyncclick",

0 commit comments

Comments
 (0)