Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format with ruff instead of black #1151

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

morbult
Copy link
Contributor

@morbult morbult commented Feb 17, 2025

This PR replaces black with ruff's formatter. Ruff is already used for linting so why not use one tool instead of two here.

Line length is kept at 120.

As seen in ee60e89, some things are formatted a little differently although ruff is designed as a drop-in replacement for black.
Some deviations are known and I think in this case these are all the deviations happening:

@@ -0,0 +1,3 @@
pip install --upgrade ruff~=0.9.0 && ^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be replaced with pre-commit autoupdate && pre-commit run -a if Daniel is okay with it. Then there's no need to specify ruff versions in multiple places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing. I haven't used pre-commit but if I understand correctly this change would require each contributor to first install pre-commit and install it on this repo, otherwise they would just get an error. So should we also add pip install -U pre-commit && pre-commit install before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants