Closed wbolster closed 5 years ago
On some lines I get this error:
error: cannot format /tmp/tmp_n05tpf2.py: Cannot parse: 3:0: <line number missing in source>
Didn't go into the cause yet, maybe python-nav-beginning/end-of-statement
doesn't always return a line number?
@rjprins can you provide me with an example of such a line/statement?
minimal example:
if True:
pass
the if True:
line is not a full python program, so black
cannot parse it, resulting in a message like
error: cannot format /run/user/1000/tmpjf9a9ssn.py: Cannot parse: 2:0: <line number missing in source>
pretty sure this is a https://github.com/wbolster/black-macchiato limitation, not a problem in the python-black-statement
command.
been using this for a bit today, and it seems to work just fine for the majority of cases.
This adds a
python-black-statement
interactive command to reformat the Python statement at point. Python statement boundary detection uses the built-inpython.el
navigation functions (python-nav-*
).