Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOML formatting using pyproject-fmt #299

Merged
merged 15 commits into from
Sep 2, 2024
Merged

TOML formatting using pyproject-fmt #299

merged 15 commits into from
Sep 2, 2024

Conversation

flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented Jul 30, 2024

Fixes #212

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

Copy link

A PR has been generated to the instance repo:
scverse/cookiecutter-scverse-instance#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.

biome.jsonc Outdated Show resolved Hide resolved
biome.jsonc Outdated Show resolved Hide resolved
{{cookiecutter.project_name}}/pyproject.toml Outdated Show resolved Hide resolved
@grst
Copy link
Collaborator

grst commented Jul 30, 2024

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
Copy link
Member Author

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 biomejs/pre-commit#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
Copy link
Member Author

flying-sheep commented Aug 23, 2024

Moved the biome part of this to #304

@flying-sheep flying-sheep changed the title Update formatters TOML formatting using pyproject-fmt Aug 23, 2024
@flying-sheep flying-sheep marked this pull request as ready for review August 23, 2024 10:44
@flying-sheep flying-sheep requested a review from grst August 23, 2024 10:44
Copy link
Collaborator

@grst grst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd (slightly) prefer this one over taplo - In addition to the reasons you mentioned it

  • doesn't require another .<formatter> config file
  • seems to do more stuff that's specific to pyproject.toml, but useful (such as sorting dependencies)

@flying-sheep
Copy link
Member Author

flying-sheep commented Aug 25, 2024

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
Copy link
Member Author

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

@flying-sheep flying-sheep merged commit f2bda60 into main Sep 2, 2024
7 checks passed
@flying-sheep flying-sheep deleted the update-formatters branch September 2, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOML formatting
2 participants