-
Notifications
You must be signed in to change notification settings - Fork 29
Remove cruft #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove cruft #38
Conversation
@@ -56,83 +54,11 @@ class Flake8(PythonLinter): | |||
'--max-line-length=': None, | |||
'--max-complexity=': -1, | |||
'--jobs=': '1', | |||
'--show-code=': False | |||
'show-code': False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's essentially the thing to fix #35. Double '--' means that this is an argument for flake8, but we want it to be an internal argument for the linter.
Well, can you make the linter happy? |
Really nice patch! So fix build and merge to master :) |
Ok, what's going on here with travis? @groteworld |
Yippie! Can't wait for a new release with this! 🎊 🍻 🎉 |
|
||
|
||
class Flake8(PythonLinter): | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only line causing the travis failure:
The command "flake8 . --max-line-length=120" exited with 1.
$ pep257 . --ignore=D202
./linter.py:16 in public class `Flake8`:
D211: No blank lines allowed before class docstring (found 1)
Can you remove this so the build passes? I'd love to see this merged 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually either get a D211: No blank lines allowed before class docstring (found 1)
https://travis-ci.org/SublimeLinter/SublimeLinter-flake8/builds/129267208 or a D203: 1 blank line required before class docstring (found 0)
https://travis-ci.org/SublimeLinter/SublimeLinter-flake8/builds/129247772
Ah, referring to PyCQA/pydocstyle#141 we loose the default ignore D203 as soon as we pass our own ignore info to pep257. |
53fa4ac
to
a33474c
Compare
@@ -148,35 +74,17 @@ def split_match(self, match): | |||
if near: | |||
col = None | |||
|
|||
if self.show_code: | |||
if self.get_view_settings().get('show-code'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_view_settings
should be enough
Okay, we're green. 🙌 |
😀 |
Again, referring to PyCQA/pydocstyle#141, you should be using the Edit: Actually, this has already been changed upstream an is the cause for the merge conflict. Anyway, please merge this. I'm struck by #33 too and implemented the changes manually in an override package for now. |
* Never use builtin python 3.3 for linting Fixes SublimeLinter#33 * Make `show-code` actually work Fixes SublimeLinter#35 * Add option `executable` so you can point explicitly to a flake8 installation in case SL's which isn't smart enough (which it isn't on Windows)
Rebased! |
Does anybody know the/one of the maintainer(s)? B/c from my experience it is either you get a response relatively quickly or never. And after two weeks we're heading towards never. |
@groteworld can you help with this pr? |
push This plugin is unusable for Python 3.5 code without this PR. |
Great fix! 🎊 Will my local version of SublimeLinter-flake8 be updated automatically or does there have to be a release? |
There already is a release. Package control will update it automatically on the next st restart. |
Guys, something goes wrong after update.
And my flake8 version and path:
Any ideas? |
I get the same error as @Gr1N, I think the offending row is the debug line just above what was posted:
Note the prefix "/usr/local/bin/python". Doing the same call in the terminal reproduces it:
Removing the python executable works fine:
|
Damn it. Works for me. |
Can you post your configuration. On my system I have python 2.7 and 3.5, mostly everything in virtualenvs. And it just works. Default python is 2.7, and a globally installed flake8. EDIT: I noticed that the version query always goes to the default python, global flake8 installation, maybe that's not good. |
I have python 2.7 (default) and 3.5 and I use virtualenvs too, but More logs:
|
I have python 2.7 as default (installed via homebrew) and Python 3.4 in paralell. I have flake installed inside a virtualenv running Python 3.4. |
You sure have some linter config as well. ;-) Esp. you could have something in |
Could you try diff --git a/linter.py b/linter.py
index 29bdb0c..d21b5e7 100644
--- a/linter.py
+++ b/linter.py
@@ -19,7 +19,7 @@ class Flake8(PythonLinter):
"""Provides an interface to the flake8 python module/script."""
syntax = 'python'
- cmd = ('flake8@python', '*', '-')
+ cmd = ('flake8', '*', '-')
version_args = '--version'
version_re = r'^(?P<version>\d+\.\d+\.\d+)'
version_requirement = '>= 2.2.2'
|
I'll try, but I've never modified a plugin file before. I'm on Mac OSX. Installed plugin through Package Control. Where can I find the linter.py file? |
Use https://packagecontrol.io/packages/PackageResourceViewer to access and modify a resource file. |
@kaste your fix works perfect.
|
Thanks @FichteFoll, that was easier than I thought. Modifying the file works great for me too. I guess my case is slightly different since I start sublime from inside a virtualenv where flake8 is installed. Non the less, it works! Thanks. |
Some more feedback on my hotfix? I remember I had this in the first version of this PR, but I don't know anymore why I decided against it. |
Follow up #41. |
[Hotfix] Completely remove invariant python handling for this plugin
show-code
actually work Fixes show-code option is not working #35executable
so you can point explicitly to a flake8 installation in case SL isn't smart enough (which it isn't on Windows)Fixes #34, fixes #36