I have added the file pyproject.toml to the root folder, I have copied the default configuration from the docs and modified two settings (I like single quotes and longer lines).
Then I have executed ruff format, and the code was formatted as expected.
Then I committed, pushed, refreshed the IDE, pressed Alt+Shift+F, and the code was formatted back as it was earlier (with double quotes and shorter lines).
Looks like the ruff.toml has a bug but .ruff.toml and pyproject.toml should work. So if they’re not I can take a look (I’m away right now but expect to be able to look at this early next week).
Edit: yes it looks like there’s a bug. I’ll let you know when that gets fixed. (Things load in a slightly different order locally and it looks like the first config is winning)
This is where I always had the problem, @owen.campbell 's tip about windows now having openssh available lead me to these two links that helped me just install everything using an administrator powershell.
When you create the private/public key file, you will want to be running powershell as your windows user, not administrator though.
At first you’ll get warnings about the order of your imports
but these should be fixable
Click the fix imports button from the linter
and hello beautifully sorted imports
These days, I categorically sort my imports by source:
Anvil
Python standard library
Third-party packages
Client code
Server code
(Some of my older modules don’t do that, but they should.) So that would be the first key to sort by. It seems unlikely that Ruff would sort like that.
I have tried adding these options. They do not seem to affect the formatter, and that could be because I’m testing it with a very simple app, but I see an unexpected result. Well, unexpected to me… is this what is supposed to happen?