pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

Add prettier and pygrep hooks to pre-commit hooks #9644

Closed Armavica closed 4 days ago

Armavica commented 1 month ago

Towards #8239. This mainly addresses problems in rst and markdown files.

max-sixty commented 1 month ago

Overall looks great!

We should check some of those, I added a couple of comments, though not a complete review.

To the extent that some might interfere with mypy or ruff, etc, that's not good — we don't want to be in a situation where code can't get through both checkers. Are we OK there?

The markdown & rst checkers look overall great!

headtr1ck commented 1 month ago

Why don't we instead try to rely on ruff and enable these rules there? Many seems supported already, rules start with PGH*.

max-sixty commented 1 month ago

Why don't we instead try to rely on ruff and enable these rules there? Many seems supported already, rules start with PGH*.

Definitely preferable for the python ones. (though formatting non-python files would still be part of this sort of effort...)

Armavica commented 6 days ago

Thank you for all your comments, I switched to prettier which seems to do a less surprising job in many cases. I also deselected the pygrep-hooks that are already checked by ruff.