python-cachier / cachier

Persistent, stale-free, local and cross-machine caching for Python functions.
MIT License
542 stars 60 forks source link

precommit: switch `flake8` with Ruff #157

Closed Borda closed 8 months ago

Borda commented 8 months ago

Just a suggestion and show what it would mean...

Recently Ruff has become very popular among also mainstream projects for:

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8a829df) 99.41% compared to head (7d7c25e) 99.41%. Report is 1 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/python-cachier/cachier/pull/157/graphs/tree.svg?width=650&height=150&src=pr&token=fhsTDs7HL9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier)](https://app.codecov.io/gh/python-cachier/cachier/pull/157?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier) ```diff @@ Coverage Diff @@ ## master #157 +/- ## ======================================= Coverage 99.41% 99.41% ======================================= Files 5 5 Lines 513 513 Branches 87 87 ======================================= Hits 510 510 Misses 2 2 Partials 1 1 ``` ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/python-cachier/cachier/pull/157?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/python-cachier/cachier/pull/157?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier). Last update [8a829df...7d7c25e](https://app.codecov.io/gh/python-cachier/cachier/pull/157?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-cachier).
shaypal5 commented 8 months ago

Ok, a few questions:

  1. What's the "W" linter? E is pycodestyle and F is pyflakes (at least in the Ruff tutorial).

  2. Can you gauge the effect of running it with the suggested configuration?

  3. What not start just with one of the flake8 implementations (I see flake8-bugbear, denoted with "B", is popular enough) for this PR, and then suggest incremental additions of a single additional linter at a time? This will make a discussion on the topic much easier.

I'll approve a PR moving our flake8 linting to Ruff without much discussion. Let's start with that, please. @Borda

Borda commented 8 months ago
  1. What's the "W" linter? E is pycodestyle and F is pyflakes (at least in the Ruff tutorial).

They are pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w

  1. Can you gauge the effect of running it with the suggested configuration?

This is already applied, so as we did not add any new rules, just 1:1 with flake8 the result is identical

  1. What not start just with one of the flake8 implementations (I see flake8-bugbear, denoted with "B", is popular enough) for this PR, and then suggest incremental additions of a single additional linter at a time? This will make a discussion on the topic much easier.

yes exactly the is just rewrite flake8 without any addition and if any other full shall be enabled, lest do each in separate PR