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

Consider switching to Ruff for pre-commit linting/formatting #623

Open
chriszs opened this issue Mar 10, 2024 · 7 comments
Open

Consider switching to Ruff for pre-commit linting/formatting #623

chriszs opened this issue Mar 10, 2024 · 7 comments

Comments

@chriszs
Copy link
Contributor

chriszs commented Mar 10, 2024

I noticed that pre-commit was running slowly on a minor change. I've recently checked out Ruff, which claims "drop-in parity with Flake8, isort, and Black," each of which are separate steps in pre-commit right now, while benchmarking at much higher speeds. It also seems to have some pyupgrade compatibility.

@chriszs
Copy link
Contributor Author

chriszs commented Mar 10, 2024

There do seem to be some deliberate differences from Back: https://docs.astral.sh/ruff/formatter/black/

In some initial testing on the codebase, the differences seemed exceedingly minor (Ruff on the right):

Screenshot 2024-03-10 at 6 31 51 PM Screenshot 2024-03-10 at 6 31 41 PM

@stucka
Copy link
Contributor

stucka commented Mar 10, 2024

Shouldn't we leave this open for review, @chriszs ? It sounds like it absolutely merits a look ... ?

@chriszs
Copy link
Contributor Author

chriszs commented Mar 17, 2024

It does! But is there a path to acceptance? If the issue is going to wind up stale, I'd rather close it and bring it back out later so that issues reflect stuff we can act on. I want to be sensitive to the project lifecycle, which seems to be maintenance as part of a larger suite of stuff, where consistency might matter more than other considerations.

@chriszs
Copy link
Contributor Author

chriszs commented Sep 8, 2024

Re-opening because Ruff now has a complimentary package manager in uv (okay, technically they're independent, but from the same source and built the same way). Both have been well-reviewed.

@chriszs chriszs reopened this Sep 8, 2024
@stucka
Copy link
Contributor

stucka commented Sep 8, 2024

Hey @newsroomdev , this seems like it might now be in your bailiwick?

@stucka
Copy link
Contributor

stucka commented Sep 9, 2024

I think this absolutely merits a look, but should probably be done in coordination with a general update and evaluation of the existing testing suite ... which I tried to get to months ago, and poked at, and then got pulled off.

This sounds like it may be eminently useful and practical on multiple levels. If adopted, we'll want to plan some time for implementing this into related repositories and updating the code there to fit. That might not be a heavy lift, especially WRT to the lift and testing of updating the testing suite. Thank you for bringing this, @chriszs .

@stucka
Copy link
Contributor

stucka commented Sep 9, 2024

And man ... this gives me pause. https://community.plone.org/t/drop-black-isort-flake8-and-use-ruff/16413/6

Linting is great. Breaking code is ... not. =)

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

No branches or pull requests

2 participants