Skip to content

Commit 976562a

Browse files
committed
[don't merge] Just to test the bot.
1 parent f32011c commit 976562a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

black_out/tasks.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@
88

99
app = celery.Celery("black_out")
1010

11-
app.conf.update(
12-
BROKER_URL=os.environ["REDIS_URL"], CELERY_RESULT_BACKEND=os.environ["REDIS_URL"]
13-
)
11+
app.conf.update(BROKER_URL=os.environ["REDIS_URL"], CELERY_RESULT_BACKEND=os.environ["REDIS_URL"])
1412

1513

1614
@app.task(rate_limit="1/m")
1715
def setup_repo():
1816

19-
repo_name = os.environ.get("GH_REPO_NAME")
20-
repo_full_name = os.environ.get("GH_REPO_FULL_NAME")
21-
os.mkdir("repo_checkout")
17+
repo_name = os.environ.get('GH_REPO_NAME')
18+
repo_full_name = os.environ.get('GH_REPO_FULL_NAME')
19+
os.mkdir('repo_checkout')
2220
os.chdir("repo_checkout")
2321
print(f"Setting up {repo_name} repository, cloning from {repo_full_name}")
2422

@@ -27,7 +25,7 @@ def setup_repo():
2725
full_name = os.environ.get("GH_FULL_NAME")
2826
subprocess.check_output(
2927
[
30-
"git",
28+
'git',
3129
"clone",
3230
f"https://{os.environ.get('GH_AUTH')}:x-oauth-basic@github.com/{repo_full_name}.git",
3331
]
@@ -58,7 +56,8 @@ def initiate_black_task(issue_number, issue_creator):
5856
7. git branch -D issue-NNNN-initialize-black
5957
"""
6058
# cd to the checked out repo, if not already there
61-
if "repo_checkout" in os.listdir("."):
59+
if "repo_checkout" \
60+
in os.listdir("."):
6261
os.chdir("repo_checkout")
6362
os.chdir(f"./{os.environ.get('GH_REPO_NAME')}")
6463

@@ -147,10 +146,13 @@ def black_pr_task(pr_number, pr_author, pr_diff_url):
147146
util.delete_branch(branch_name)
148147

149148

150-
class InitRepoStep(bootsteps.StartStopStep):
149+
class InitRepoStep(
150+
bootsteps.StartStopStep,
151+
):
151152
def start(self, c):
152153
print("Initialize the repository.")
153154
setup_repo()
154155

155156

156-
app.steps["worker"].add(InitRepoStep)
157+
app.steps["worker"].add(
158+
InitRepoStep)

0 commit comments

Comments
 (0)