Skip to content

Commit 7fcff5e

Browse files
committed
MAINT: Update setup.cfg (flake8 and pytest)
- Ignore W503 (boolean operator after line break) - Add settings section for pytest
1 parent dcbde6e commit 7fcff5e

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

fmriprep/utils/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def check_deps(workflow):
99
return sorted(
1010
(node.interface.__class__.__name__, node.interface._cmd)
1111
for node in workflow._get_all_nodes()
12-
if (hasattr(node.interface, '_cmd') and
13-
which(node.interface._cmd.split()[0]) is None))
12+
if (hasattr(node.interface, '_cmd')
13+
and which(node.interface._cmd.split()[0]) is None))

fmriprep/workflows/bold/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,11 @@ def init_func_preproc_wf(bold_file):
206206
fmaps = {'syn': False}
207207

208208
# Short circuits: (True and True and (False or 'TooShort')) == 'TooShort'
209-
run_stc = (bool(metadata.get("SliceTiming")) and
210-
'slicetiming' not in config.workflow.ignore and
211-
(_get_series_len(ref_file) > 4 or "TooShort"))
209+
run_stc = (
210+
bool(metadata.get("SliceTiming"))
211+
and 'slicetiming' not in config.workflow.ignore
212+
and (_get_series_len(ref_file) > 4 or "TooShort")
213+
)
212214

213215
# Build workflow
214216
workflow = Workflow(name=wf_name)

fmriprep/workflows/bold/tests/test_confounds.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from ..confounds import _add_volumes, _remove_volumes
77

88

9-
skip_pytest = pytest.mark.skipif(not os.getenv('FMRIPREP_REGRESSION_SOURCE') or
10-
not os.getenv('FMRIPREP_REGRESSION_TARGETS'),
11-
reason='FMRIPREP_REGRESSION_{SOURCE,TARGETS} env vars not set')
9+
skip_pytest = pytest.mark.skipif(
10+
not os.getenv('FMRIPREP_REGRESSION_SOURCE')
11+
or not os.getenv('FMRIPREP_REGRESSION_TARGETS'),
12+
reason='FMRIPREP_REGRESSION_{SOURCE,TARGETS} env vars not set'
13+
)
1214

1315

1416
@skip_pytest

setup.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,18 @@ parentdir_prefix =
106106
max-line-length = 99
107107
doctests = True
108108
exclude=*build/
109+
ignore =
110+
W503
111+
per-file-ignores =
112+
**/__init__.py : F401
113+
docs/conf.py : E265
114+
115+
[tool:pytest]
116+
norecursedirs = .git
117+
addopts = -svx --doctest-modules
118+
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS
119+
env =
120+
PYTHONHASHSEED=0
121+
filterwarnings =
122+
ignore::DeprecationWarning
123+
junit_family=xunit2

0 commit comments

Comments
 (0)