scverse / cookiecutter-scverse

Cookiecutter template for scverse
https://cookiecutter-scverse-instance.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
71 stars 9 forks source link

TOML formatting using pyproject-fmt #299

Closed flying-sheep closed 3 months ago

flying-sheep commented 4 months ago

Fixes #212

An alternative to #225, see #212 for a comparison

github-actions[bot] commented 4 months ago

A PR has been generated to the instance repo: https://github.com/scverse/cookiecutter-scverse-instance/pull/138

You can check out the PR to preview your changes in an instance of the cookiecutter template. The PR will be kept in sync with this PR automatically.

grst commented 4 months ago

I like it in principle! Shall we wait a bit longer until the biome-pre-commit and pyproject-fmt are maturing a bit more? How likely is it that pyproject-fmt will become part of ruff?

flying-sheep commented 4 months ago

Shall we wait a bit longer until the biome-pre-commit and pyproject-fmt are maturing a bit more?

I think pyproject-fmt is mature enough, for biome-pre-commit we should maybe wait until someone replies to my comment in https://github.com/biomejs/pre-commit/issues/5

How likely is it that pyproject-fmt will become part of ruff?

it’s a completely separate rust project, and targets a different type of file, so maybe not that likely?

but then again the ruff people have adopted uv and rye so who knows!

flying-sheep commented 3 months ago

Moved the biome part of this to https://github.com/scverse/cookiecutter-scverse/pull/304

flying-sheep commented 3 months ago

OK! Do you think we should leave it unconfigured (2 spaces indent) or add

[tool.pyproject-fmt]
indent = 4

for the taplo branch, I configured it because the diff would be minimal, but this PR will probably result in

  1. the cruft sync failing in all repos using this
  2. the pre-commit autofixing reformat the pyproject.toml entirely anyway
flying-sheep commented 3 months ago

Welp, we should decide on indents before next release, but I’m going to merge this