There is a space in front of the per-file-ignore entry in the flake8 config (added in scverse/scanpy#1689). This is the same in scanpy, as the config here was just copied from there. This causes a parse failure which leads to the the per-file-ignores becoming global instead. To demonstrate:
Parse failure
From the root of the repo
>>> from flake8.api.legacy import get_style_guide
>>> get_style_guide().options.ignore
['#',
'module',
'imported',
'but',
'unused',
'->',
'required',
'for',
'Scanpys',
'API',
'F401',
'W503',
'W504',
'E501',
'E203',
'E231',
'E402',
'E126',
'E262',
'E266',
'E731',
'E741',
'per-file-ignores',
'=',
'tests/test*.py:',
'F811',
'anndata/compat/_overloaded_dict.py:',
'F821',
'anndata/tests/test_readwrite.py:',
'E721']
Fixing the parse error reveals a number of flake8 errors which were accidentally being ignored. I came across this while adding back F401, since it should only be ignored for files which define a namespace.
It is kind of ironic that a tool for enforcement of code style is permissive to a fault about config parsing.
(ping @Zethson)
There is a space in front of the
per-file-ignoreentry in theflake8config (added in scverse/scanpy#1689). This is the same in scanpy, as the config here was just copied from there. This causes a parse failure which leads to the theper-file-ignores becoming global instead. To demonstrate:Parse failure
From the root of the repo
Fixing the parse error reveals a number of flake8 errors which were accidentally being ignored. I came across this while adding back
F401, since it should only be ignored for files which define a namespace.It is kind of ironic that a tool for enforcement of code style is permissive to a fault about config parsing.
(ping @Zethson)