Ruff autoformatting expressions/ folder#902
Conversation
|
we're now consistently typing the code, having a consistent style with a preconfigured linter could also help in being more mature but auto-formatting? I think we're a bit too far away from that... I see that ruff also has IDE plugins; if we each install that and when working on code, we make sure that we fix the linter warnings, then I think we have a more gradual way forward? We are touching large parts of the code for another month anyway... and then maybe after doing it when we make code changes that we could consider autoformatting... note that I would also be open for PRs that fix one linter warning; e.g. making sure all strings use " could be one, or starting each comment with a Capital letter, or things like that. (the multi-line imports and function calling, I find it less readable, so I will have to get used to that more slowly) do the IDE integrations also follow the project.toml? because then perhaps we could already include just that? |
|
I wanted to add a few loose points to adding auto-formatting, since I had thought a bit about it previously:
|
As discussed offline, I played around with
ruffa little bit.You can go very far in configuring its rules, some are quite pedantic imho...
This is just a PR to show how our
expressions/folder could look like if we were to add autoformatting.I've enabled the recommended doc-styles and standard pyflakes code formatting, but enabled some rules of it as they were too incompatible with the current code base...
If we decide to go with autoformatting, there is also the question on how to integrate it continuously... Formatting the entire code base at once will destroy our git history, but after chatting with a friend, they suggested me a few options:
git config blame.ignoreRevsFile .git-blame-ignore-revsWe can also setup the autoformatting in the CI of course so we don't all have to do it locally.