Skip to content

Commit 10dbe23

Browse files
committed
Add relaxed flake8 config from jupyterhub and enforce it
1 parent b128d23 commit 10dbe23

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.flake8

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[flake8]
2+
# Ignore style and complexity
3+
# E: style errors
4+
# W: style warnings
5+
# C: complexity
6+
# F401: module imported but unused
7+
# F403: import *
8+
# F811: redefinition of unused `name` from line `N`
9+
# F841: local variable assigned but never used
10+
# E402: module level import not at top of file
11+
# I100: Import statements are in the wrong order
12+
# I101: Imported names are in the wrong order. Should be
13+
ignore = E, W, C, F401, F403, F811, F841, E402, I100, I101, D400

batchspawner/tests/test_spawners.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_torque(db, io_loop):
359359
(re.compile(r"sudo.*qsub"), str(testjob)),
360360
(
361361
re.compile(r"sudo.*qstat"),
362-
"<job_state>Q</job_state><exec_host></exec_host>".format(testhost),
362+
"<job_state>Q</job_state><exec_host></exec_host>",
363363
), # pending
364364
(
365365
re.compile(r"sudo.*qstat"),
@@ -403,7 +403,7 @@ def test_moab(db, io_loop):
403403
]
404404
script = [
405405
(re.compile(r"sudo.*msub"), str(testjob)),
406-
(re.compile(r"sudo.*mdiag"), 'State="Idle"'.format(testhost)), # pending
406+
(re.compile(r"sudo.*mdiag"), 'State="Idle"'), # pending
407407
(
408408
re.compile(r"sudo.*mdiag"),
409409
'State="Running" AllocNodeList="{}"'.format(testhost),
@@ -446,7 +446,7 @@ def test_pbs(db, io_loop):
446446
]
447447
script = [
448448
(re.compile(r"sudo.*qsub"), str(testjob)),
449-
(re.compile(r"sudo.*qstat"), "job_state = Q".format(testhost)), # pending
449+
(re.compile(r"sudo.*qstat"), "job_state = Q"), # pending
450450
(
451451
re.compile(r"sudo.*qstat"),
452452
"job_state = R\nexec_host = {}/2*1".format(testhost),
@@ -582,7 +582,7 @@ def test_condor(db, io_loop):
582582
re.compile(r"sudo.*condor_submit"),
583583
"submitted to cluster {}".format(str(testjob)),
584584
),
585-
(re.compile(r"sudo.*condor_q"), "1,".format(testhost)), # pending
585+
(re.compile(r"sudo.*condor_q"), "1,"), # pending
586586
(re.compile(r"sudo.*condor_q"), "2, @{}".format(testhost)), # runing
587587
(re.compile(r"sudo.*condor_q"), "2, @{}".format(testhost)),
588588
(re.compile(r"sudo.*condor_rm"), "STOP"),
@@ -621,7 +621,7 @@ def test_lfs(db, io_loop):
621621
re.compile(r"sudo.*bsub"),
622622
"Job <{}> is submitted to default queue <normal>".format(str(testjob)),
623623
),
624-
(re.compile(r"sudo.*bjobs"), "PEND ".format(testhost)), # pending
624+
(re.compile(r"sudo.*bjobs"), "PEND "), # pending
625625
(re.compile(r"sudo.*bjobs"), "RUN {}".format(testhost)), # running
626626
(re.compile(r"sudo.*bjobs"), "RUN {}".format(testhost)),
627627
(re.compile(r"sudo.*bkill"), "STOP"),

0 commit comments

Comments
 (0)