SublimeLinter / SublimeLinter-flake8

SublimeLinter plugin for python, using flake8.
MIT License
184 stars 28 forks source link

flake8(erred) on Python 3.7 due to warning? #91

Closed jaraco closed 6 years ago

jaraco commented 6 years ago

I have flake8 installed in Python 3.7.0b3. When I run Flake8 on a package with no lint, I see this output:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

Even though the return value is 0.

The warning is ignorable and probably will be fixed by subsequent releases of flake8 and pycodestyle. In the meantime, I suspect it's what's causing the flake8(erred) indication in ST3.

image

If I uninstall flake8 on Python 3.7 and install it for Python 3.6, the (erred) goes away.

Should these warnings be suppressed or at least not indicate that the linter failed?

jaraco commented 6 years ago

I did find I could work around the issue by installing the yet-unreleased flake8 from gitlab master, but it seems there still may be an issue with the linter that it shouldn't have 'erred' due to a warning. Your call, though.

kaste commented 6 years ago

You're using beta stuff, you're out. Lol.

On the pro: it should still work even though it says erred. It should still report and highlight the actual lint errors if any. And erred would indicate that there is some output additionally that you should read/react to.

Ah well. I don't know if FutureWarning is something we should expect and suppress. It would be easy to catch though. Is this something flake8 will issue in the future. Will flake8 have an arg to suppress these warnings?

jaraco commented 6 years ago

I suspect flake8 will not and probably should not suppress the warnings, and now that I think about the interface that this plugin has with the linter, it probably would have to whitelist lines by pattern to ignore them. So probably the best thing to do is just wait for the new release of flake8 for those who wish to use Python 3.7.

h-jia commented 5 years ago

I figured this error by adding follow codes in SublimeLinter.sublime-settings --User

{   
    "linters": {
    "flake8": {
    "@disable": false,
    "args": [],
    "builtins": "",
    "excludes": [],
    "executable": ["/Users/yourname/miniconda3/bin/python", "-m", "flake8"],
    "ignore": "E501",
    "jobs": "1",
    "max-complexity": -1,
    "max-line-length": null,
    "select": "",
    "show-code": false,
},
}
}