openlawlibrary / pygls

A pythonic generic language server
https://pygls.readthedocs.io/en/latest/
Apache License 2.0
568 stars 103 forks source link

chore: introduce `black` formatting #354

Closed tombh closed 1 year ago

tombh commented 1 year ago

Black is an opinionated code formatter https://black.readthedocs.io/en/stable/

This introduces a lot of formatting changes.

~This has the downside of now assigning all these changes to me, the committer, which means we lose some nuance as to the history and context of the original changes. But maybe it is better to "rip the bandage" to begin enjoying consistent formatting?~ This isn't actually such a problem because of .git-blame-ignore-revs

TODO:

Code review checklist (for code reviewer to complete)

alcarney commented 1 year ago

This has the downside of now assigning all these changes to me, the committer, which means we lose some nuance as to the history and context of the original changes.

I stumbled across something that might help with this a little while ago - .git-blame-ignore-revs it looks like you can configure git to ignore some commits when doing a git blame

Looks like GitHub supports it too

tombh commented 1 year ago

Nice! Added it 😀

dimbleby commented 1 year ago

scripts/generate_client.py currently outputs non Black-compatible code

another way would be just not to format the generated code

[tool.black]
exclude = "pygls/lsp/whatever"
tombh commented 1 year ago

Nice idea! Updated and all green CI now, thanks.