lucyparsons / OpenOversight

Police oversight and accountability through public data 👮
https://openoversight.com
GNU General Public License v3.0
240 stars 79 forks source link

Replace `flake8` with `ruff` #1101

Closed michplunkett closed 5 months ago

michplunkett commented 5 months ago

Description of Changes

Replacing flake8 with ruff, which has approximate parity and is more than 10x faster: https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-flake8

Tests and Linting

michplunkett commented 5 months ago

@sea-kelp, I definitely get the hesitancy. I BELIEVE most every part of the code modified here is covered in test cases. Would you feel more comfortable with these changes if I were to verify that every line change was covered by tests?

I also think there's a difference between changes in HTML versus Python syntax changes. The Python changes can be verified through a handful of mechanisms that are generally unavailable to HTML changes. Most of the changes here are also syntax changes that are more in line with Python best practices, which I think is of value as well (e.g., isinstance versus type comparisons, removal of redundant map function calls, etc.).

If there's a specific change you're curious or have questions about, I'd certainly be willing to go more into it.

michplunkett commented 5 months ago

Thanks for taking a look, @sea-kelp! I'll let you know when the changes are made.