Skip to content

Conversation

@dsaxton
Copy link
Contributor

@dsaxton dsaxton commented Sep 17, 2020

The flake8 version used in pre-commit-config.yaml seems to emit spurious errors when there are mypy comments for ignoring specific kinds of type errors. Bumping to the latest version of flake8 seems to fix this.

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

pandas/core/generic.py:701:36: F821 undefined name 'ignore'
pandas/core/generic.py:701:36: F821 undefined name 'arg'
pandas/core/generic.py:4220:39: F723 syntax error in type comment 'ignore[return-value, arg-type]'
pandas/core/generic.py:4283:39: F723 syntax error in type comment 'ignore[return-value, arg-type]'

For reference this is line 701 that it's complaining about:

            new_values, *new_axes  # type: ignore[arg-type]

ref PyCQA/pyflakes#455

@jorisvandenbossche jorisvandenbossche added the Code Style Code style, linting, code_checks label Sep 17, 2020
@jorisvandenbossche
Copy link
Member

So we are actually pinning flake8 to an older version (#34150) for the code checks. But it seems that most issues have been resolved (eg #34152), only the flake8-rst compatibility not yet. But that is something we don't need to care about for pre-commit. So updating here should be good.

@jorisvandenbossche jorisvandenbossche merged commit 3a15e47 into pandas-dev:master Sep 17, 2020
@dsaxton dsaxton deleted the bump-pre-commit-flake8 branch September 17, 2020 12:13
rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request Sep 17, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Style Code style, linting, code_checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants