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

Use ruff for formatting too #645

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Use ruff for formatting too #645

merged 1 commit into from
Jun 11, 2024

Conversation

akx
Copy link
Contributor

@akx akx commented May 27, 2024

Following up on ruff being added for linting in #610, this makes formatting also use ruff instead of Black.

@Pierre-Sassoulas
Copy link
Member

LGTM but this is not my decision to make.

Copy link
Member

@ionelmc ionelmc left a comment

Choose a reason for hiding this comment

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

This might be a good time to replace [tool.ruff.lint.flake8-quotes] inline-quotes = "single" with [tool.ruff.format] quote-style = "single".

This ruff formatter seems new, or I have been time traveling :)) - what is your experience with it?

@Pierre-Sassoulas
Copy link
Member

It's available since November 2023 afair. In m'y experience It's faster than black, and it also permits to not argue about formatting. (Equivalent at first but they started to drift apart after black's 2024 style.. two months after first release). As long as it's pre-commit enforced and you don't have strong opinion about following black's style, it should not be a problem and a small quality of life increase when committing or reading the pre-commit conf.

@akx
Copy link
Contributor Author

akx commented May 28, 2024

This ruff formatter seems new, or I have been time traveling :)) - what is your experience with it?

It's pretty new, yeah, but it's been rock stable and fast (as all of Astral's tools seem to be...). 99% compatible with the Black style, with some changes that are IMO for the better.

I can switch the quote styles around, sure, but that'll probably be a much larger diff. So – enforce single quotes everywhere is the preference?

@ionelmc
Copy link
Member

ionelmc commented May 28, 2024

Enforcing single quotes everywhere is what [tool.ruff.lint.flake8-quotes] inline-quotes = "single" was supposed to do. I guess I have to try this and see how it goes.

@ionelmc ionelmc merged commit d4ef48f into pytest-dev:master Jun 11, 2024
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants