Open benjamin-kirkbride opened 1 week ago
As far as ruff goes, we already use it for linting, so using it for the import sorting is trivial.
Really just need to exclude the examples code from autoformatting as far as exclusions go, maybe the experimental directory because there are technically examples in that? Not sure autoformatting matters for any of those though.
I don't think we care about git blame preservation
We definitely don't care about blame preservation.
Things that probably need to happen for this:
Isn't step one actually some kind of broader consensus? Who needs to sign off?
Autoformatting the imports may break a bunch of stuff at first, due to.. load bearing import order
Those steps were just like, assuming it was happening, we probably have very little load bearing import order left. The 3.0 work cleaned up a lot of Arcade import. I would probably be in favor of excluding __init__.py
files from the formatting though, the top level one is probably a minefield
gui is already formated with ruff and I use pre-commit hooks to enforce it on my side.
TL;DR: I am very wary of this idea.
The most important part of this (imo) is knowing how to turn it off. The following probably need to be excluded:
make.py
arcade.experimental
utils
folder can be fragile (includes more Sphinx stuff)We're refactoring the utils folder one step at a time (#2109), but it's probably best to leave it alone for now.
As to other auto-formatting options not mentioned above, there are good reasons to disable them in many cases. PEP-8 itself points out that following it dogmatically is bad. I don't think you're proposing we do so, but I'm bringing it up now so we can agree not to do so in the future.
All done
Did we sort imports too as part of this? Sorry if I missed that
.. or just make separate issue.
How do people feel about implementing (and enforcing) autoformatting in Arcade? Specifically:
Some considerations: