Blosc / python-blosc2

https://www.blosc.org/python-blosc2
Other
85 stars 19 forks source link

Apply ruff in CI #272

Closed DimitriPapadopoulos closed 1 month ago

DimitriPapadopoulos commented 2 months ago

We can run Ruff in CI:

  1. directly in a GitHub action,
  2. by applying pre-commit.ci to this repository.

I can implement the first option in a merge request, but a GitHub repository admin must enable pre-commit.ci.

@FrancescAlted I think option 2 is better. What do you think?

FrancescAlted commented 1 month ago

Ok. Added pre-commit.ci to python-blosc2. I do not have experience with ruff in CI so let's see how it goes :-)

DimitriPapadopoulos commented 1 month ago

It seems to be working. Do not hesitate to come back to me if you feel some rules are too strict or do not make sense. I didn't like ruff format at first, but I have been appreciating the formatting consistency which results in more readable code.

I'm not a huge fan of pre-commit either, but I do like its promise of running the same tests locally (pre-commit run -a) and in CI.

FrancescAlted commented 1 month ago

Ok, cool. I had the same feeling at automatic formatters initially, but when a project is growing, and getting more contributors, I think this is the only way to provide some consistency for the code. Thanks for your insights about ruff format!