This repository was archived by the owner on Feb 4, 2024. It is now read-only.
This repository was archived by the owner on Feb 4, 2024. It is now read-only.
Small optimisation of YTT202 #2
Closed
Description
With this code:
import six
if not six.PY3:
pass
The plugin correctly gives:
$ flake8 --select YTT 1.py
1.py:2:8: YTT202: `six.PY3` referenced (python4), use `not six.PY2`
Perhaps it could detect the not
before six.PY3
, and suggest a clean six.PY2
instead?
For example:
$ flake8 --select YTT 1.py
1.py:2:X: YTT20X: `not six.PY3` referenced (python4), use `six.PY2`
That is:
# Bad
if not six.PY3:
# Better (sort of)
if not not six.PY2:
# Best
if six.PY2:
Metadata
Metadata
Assignees
Labels
No labels