-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add flakehell python linter (#3295) #3921
Conversation
bc29b6c
to
59a820f
Compare
if (l:executable =~? 'pipenv\|poetry$') | ||
let l:exec_args = ' run flakehell' | ||
elseif (l:executable is? 'python') | ||
let l:exec_args = ' -m flakehell' |
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 seemed to make more sense that appending the module in the options.
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.
Impressive PR, thanks. One test on windows is failing, once that is fixed it looks good to merge:
( 7/17) [EXECUTE] (X) ['flakehell', ['flakehell --version', 'flakehell lint --format=default --stdin-display-name %s -']] should be equal to ['C:\testplugin\test\test-files\python\with_virtualenv\env\Scripts\flakehell', ['C:\testplugin\test\test-files\python\with_virtualenv\env\Scripts\flakehell --version', 'C:\testplugin\test\test-files\python\with_virtualenv\env\Scripts\flakehell lint --format=default --stdin-display-name %s -']]
59a820f
to
548f3a2
Compare
Thanks. -Execute(The flake8 callbacks should detect virtualenv directories):
+Execute(The flakehell callbacks should detect virtualenv directories):
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Simplify(
- \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/flake8'
+ \ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/flakehell'
\)
AssertLinter b:executable, [
\ ale#Escape(b:executable) . ' --version',
\ ale#Escape(b:executable)
+ \ . ' lint'
\ . ' --format=default'
\ . ' --stdin-display-name %s -',
\] And I don't see anything in the code that's done any differently with respect to flake8. |
548f3a2
to
a799a9b
Compare
Final test now passes. |
a799a9b
to
3910c0b
Compare
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.
Thanks for the contribution.
Adds flakehell.
For the moment it is just a blatant copy of the flake8 linter.