python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.91k stars 196 forks source link

Format the whole repo with Black #419

Closed tkrabel-db closed 1 year ago

tkrabel-db commented 1 year ago

What is changed in that PR?

Fixes #392, i.e. this PR auto formats the whole repo using black to see the diff.

black is arguably the most popular formatter out there.

What needs to be changed further?

Some black re-formattings violate pylint and pycodestyle, e.g.

pycodestyle

# All errors are of this form
test/test_text_edit.py:27:9: W503 line break before binary operator
...

pylint pylsp

************* Module test.test_workspace
test/test_workspace.py:240:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
test/test_workspace.py:259:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module pylsp.plugins.pylint_lint
pylsp/plugins/pylint_lint.py:292:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
pylsp/plugins/pylint_lint.py:294:0: I0021: Useless suppression of 'consider-using-with' (useless-suppression)
************* Module pylsp.plugins.rope_autoimport
pylsp/plugins/rope_autoimport.py:33:0: R0911: Too many return statements (7/6) (too-many-return-statements)
pylsp/plugins/rope_autoimport.py:35:0: I0021: Useless suppression of 'too-many-return-statements' (useless-suppression)

My suggestion: