Skip to content

Commit 4ad0157

Browse files
committed
fix flake8
1 parent 9bcd6a4 commit 4ad0157

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

homu/main.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def update_treeclosed(self, value, src):
102102
if value > 0:
103103
db_query(
104104
self.db,
105-
'INSERT INTO repos (repo, treeclosed, treeclosed_src) VALUES (?, ?, ?)',
105+
'''
106+
INSERT INTO repos (repo, treeclosed, treeclosed_src)
107+
VALUES (?, ?, ?)
108+
''',
106109
[self.repo_label, value, src]
107110
)
108111

@@ -395,6 +398,7 @@ def record_retry_log(self, src, body):
395398
[self.repo_label, self.num, src, body],
396399
)
397400

401+
398402
def sha_cmp(short, full):
399403
return len(short) >= 4 and short == full[:len(short)]
400404

@@ -1510,7 +1514,8 @@ def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_q
15101514
states,
15111515
sha=comment.original_commit_id,
15121516
command_src=comment.to_json()['html_url'],
1513-
# FIXME switch to `comment.html_url` after updating github3 to 1.3.0+
1517+
# FIXME switch to `comment.html_url`
1518+
# after updating github3 to 1.3.0+
15141519
)
15151520

15161521
for comment in pull.iter_issue_comments():
@@ -1524,7 +1529,8 @@ def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_q
15241529
db,
15251530
states,
15261531
command_src=comment.to_json()['html_url'],
1527-
# FIXME switch to `comment.html_url` after updating github3 to 1.3.0+
1532+
# FIXME switch to `comment.html_url`
1533+
# after updating github3 to 1.3.0+
15281534
)
15291535

15301536
saved_state = saved_states.get(pull.number)
@@ -1662,7 +1668,8 @@ def main():
16621668
msg TEXT NOT NULL
16631669
)''')
16641670
db_query(db, '''
1665-
CREATE INDEX IF NOT EXISTS retry_log_time_index ON retry_log (repo, time DESC)
1671+
CREATE INDEX IF NOT EXISTS retry_log_time_index ON retry_log
1672+
(repo, time DESC)
16661673
''')
16671674

16681675
# manual DB migration :/

homu/server.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def queue(repo_label):
179179
multiple=multiple,
180180
)
181181

182+
182183
@get('/retry_log/<repo_label:path>')
183184
def retry_log(repo_label):
184185
logger = g.logger.getChild('retry_log')
@@ -192,7 +193,10 @@ def retry_log(repo_label):
192193

193194
db_query(
194195
g.db,
195-
'SELECT num, time, src, msg FROM retry_log WHERE repo = ? ORDER BY time DESC',
196+
'''
197+
SELECT num, time, src, msg FROM retry_log
198+
WHERE repo = ? ORDER BY time DESC
199+
''',
196200
[repo_label],
197201
)
198202
logs = [
@@ -431,7 +435,8 @@ def github():
431435
g.db,
432436
g.states,
433437
command_src=c.to_json()['html_url'],
434-
# FIXME switch to `c.html_url` after updating github3 to 1.3.0+
438+
# FIXME switch to `c.html_url`
439+
# after updating github3 to 1.3.0+
435440
) or found
436441

437442
status = ''

0 commit comments

Comments
 (0)