dreadatour / Flake8Lint

Sublime Text plugin for lint Python files
234 stars 58 forks source link

Undefined name in f-string following non-blank lines is reported as though on Line 1 #114

Open kkurian opened 6 years ago

kkurian commented 6 years ago

Problem

When an f-string follows any number of non-blank lines, an undefined name in the f-string is reported as an error on Line 1 rather than as an error on the line of the f-string itself.

Input

import re
f'{foo}'

Result

One error marker on Line 1, the error being:

flake8: F401 're' imported by unused / F821 undefined name 'foo', Line 1, Column 10

Expected Result

An error marker on Line 1 for the F401 error. An error marker on Line 2 for the F821 error.