palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

Fix ValueError when formatting if continuation lines are incorrectly indented when using autopep8 #829

Closed lordsutch closed 4 years ago

lordsutch commented 4 years ago

This patch temporarily re-monkey-patches the _checks in pycodestyle to use autopep8's checker, and then patches things back when done. This should fix #771

NB: the patching shouldn't need to be conditional (unlike in pycodestyle_lint.py) since autopep8 always requires pycodestyle to work.

palantirtech commented 4 years ago

Thanks for your interest in palantir/python-language-server, @lordsutch! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

ccordoba12 commented 4 years ago

Thanks a lot for your contribution! Could you add a test for this?

lordsutch commented 4 years ago

Hmm, I'm not sure why the python 3 test is failing with test/test_language_server.py::test_exit_with_parent_process_died FAILED; that step runs fine on my Mac OS machine.