Skip to content

Update ruff#3476

Merged
A5rocks merged 3 commits into
python-trio:mainfrom
A5rocks:upgrade-ruff
Jul 24, 2026
Merged

Update ruff#3476
A5rocks merged 3 commits into
python-trio:mainfrom
A5rocks:upgrade-ruff

Conversation

@A5rocks

@A5rocks A5rocks commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

RUF105 in particular was being bad, because it would change our noqa to ruff:ignore, which then black looks at and reformats, which ruff would see being on the wrong line and remove + apply fixes arbitrarily around the codebase. Basically a giant mess.

I've disabled it. I wish we could get the nice human readable names (RUF106) without using ruff:ignore, but that doesn't seem possible.

@A5rocks
A5rocks marked this pull request as ready for review July 22, 2026 18:12
@CoolCat467 CoolCat467 added the dependencies Pull requests that update a dependency file label Jul 23, 2026
@CoolCat467

Copy link
Copy Markdown
Member

We could likely avoid these problems if we switched to ruff's formater instead of black, but if we were to do that I think it would be better served for another pull request.

@A5rocks
A5rocks merged commit d0e762f into python-trio:main Jul 24, 2026
45 checks passed
@A5rocks
A5rocks deleted the upgrade-ruff branch July 24, 2026 05:14
@jakkdl

jakkdl commented Jul 25, 2026

Copy link
Copy Markdown
Member

After the acquiring of astral I am slightly wary of relying even more on them, but it shouldn't be a big jump to revert back to using black.
Even better would be opening an issue / PR for black to handle ruff:ignore gracefully

@A5rocks

A5rocks commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Done: psf/black#5260

@A5rocks

A5rocks commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Hmm actually maybe it's just a matter of putting enough time in. I forgot which exact formatting loops made me give up, but it's probably possible to structure the code somehow to appease both black and ruff. I'm just not sure it's worth it. (... maybe I should open an issue here so it gets done eventually, maybe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants