Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Fix col offset #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix col offset #19

wants to merge 3 commits into from

Conversation

kaste
Copy link
Contributor

@kaste kaste commented Jun 27, 2018

mypy changed the col base. We need to normalize this column to the base flake8 expects.

Tested with mypy-0.610

E.g. before the patch

> type plugin.py | C:\Dev\python36\Scripts\flake8.exe --format default -
C:\Users\c-flo\AppData\Local\Temp\flake8mypy_ynlp41vb\tmpmypy_06s72jce.py:17:1: error: Need type annotation for 'KNOWN_WINDOWS'
C:\Users\c-flo\AppData\Local\Temp\flake8mypy_ynlp41vb\tmpmypy_06s72jce.py:53:18: error: "str" has no attribute "window"

stdin:17:2: T484 Need type annotation for 'KNOWN_WINDOWS'
stdin:53:19: T484 "str" has no attribute "window"

First comes the raw stdout from mypy. You can see that mypy reports 17:1 but the flake8 output indicates an error at 17:2

This patch of course reduces the failing Travis CI. And, unfortunately, this is again on top of my previous PR, but you can cherry-pick whatever you want. And the commits are tiny.

On Windows the temp file must be closed, otherwise mypy can't open it again.
Unfortunately, we then loose the nice to read `with` sugar and obviously
must call `os.remove` manually.
@kaste
Copy link
Contributor Author

kaste commented Jun 27, 2018

Replaces #15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant