-
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 support for black usage with pipenv #1988
Conversation
Latest failed segment. |
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 just noticed an issue here.
autoload/ale/fixers/black.vim
Outdated
|
||
let l:options = ale#Var(a:buffer, 'python_black_options') | ||
|
||
return { | ||
\ 'command': ale#Escape(l:executable) | ||
\ 'command': ale#Escape(l:executable. l:exec_args) |
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 isn't right. This will produce a command string like "pipenv run black" -
. You want something more like "pipenv" run black -
. You should move . l:exec_args
outside of the ale#Escape
call.
call ale#test#SetFilename('/testplugin/test/python_fixtures/pipenv/whatever.py') | ||
|
||
AssertEqual | ||
\ {'command': ale#Escape('pipenv run black') . ' -'}, |
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.
Fix the test here, given the suggestion above.
@mdtusz do you mind fixing some things relating to w0rp's review? After that, it should be good to merge. |
Sorry for the radio silence! Will try to get around to it this week to close it up! |
Added ability to set `python_black_auto_pipenv` to allow for usage of a local pipenv black executable.
Sorry for the extreme delays! I've fixed up the tests, but vimscript/vader is far out of my normal wheelhouse so let me know if anything looks suspect. |
Cheers! 🍻 |
For many projects and just out of habit, I have black installed using pipenv - the standard black executable will work assuming
pipenv shell
has been run before opening vim, but I often forget or haven't run it.This adds support for
black
usage withpipenv
the same way that it works withmypy
and other python tools.