netcdf4-python icon indicating copy to clipboard operation
netcdf4-python copied to clipboard

Add pyproject fmt

Open ocefpaf opened this issue 2 years ago • 5 comments

This should prevent a regression in https://github.com/Unidata/netcdf4-python/issues/1265 and complements @mwtoews https://github.com/Unidata/netcdf4-python/pull/1266.

Note that the use of pre-commits has a learning curve and while I would advocate to a even heavier use than just this one, I'm OK if this PR is closed in case folks don't want to go there. However, if you do, one can set it up locally and run pre-commit or use the pre-commit hook. Additionally one can enable pre-commit-ci and use the pre-commit.ci autofix comment in the PR to fix it automatically. Enabling pre-commit-ci has the advantages of having this as a CI check and get the auto-updates for the hooks in the .pre-commit.yaml file.

ocefpaf avatar Jul 10 '23 16:07 ocefpaf

Interesting, it broke what it was supposed to fix, the pyproject.toml! I'll try to figure out what is happening...

ocefpaf avatar Jul 10 '23 16:07 ocefpaf

Found the problem and it may be a bug in the linter. xref.: https://github.com/tox-dev/pyproject-fmt/issues/110

ocefpaf avatar Jul 11 '23 19:07 ocefpaf

There is an opendap sever failure now that is unrelated.

ocefpaf avatar Jul 11 '23 19:07 ocefpaf

This one is ready for review.

ocefpaf avatar Oct 22 '23 22:10 ocefpaf

I've been increasing my use of pre-commit (+ .ci) lately, but I've not heard of pyproject-fmt until now. I'm unsure about it's inconsistency, however. For example, some sections have a 1-line space between and others don't, some have sorted keys, others don't. Some local tests that I tried with this branch, where I've re-arranged some items in the pyproject file will yield bad formats too, so I can't grasp what the tool is trying to do.

mwtoews avatar Oct 23 '23 09:10 mwtoews