Skip to content

flake8 config error #540

Description

@ivirshup

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)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions