biglocalnews / warn-scraper

Command-line interface for downloading WARN Act notices of qualified plant closings and mass layoffs from state government websites
https://warn-scraper.readthedocs.io
Apache License 2.0
28 stars 10 forks source link

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

Closed chriszs closed 4 months ago

chriszs commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

chriszs commented 3 months ago

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.