-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Following up on Issue #293, I’d like to propose an enhancement:
While it's clear that PEP 621 does not enforce a specific TOML layout and that [project.scripts]
and [project] scripts.*
are semantically equivalent, it would be very useful if pyproject-fmt
provided an optional configuration setting to prefer one formatting style over the other during formatting.
Specifically, it would be helpful to offer users the ability to:
- Prefer expanding
[project.scripts]
as a dedicated table (more readable and common in hand-writtenpyproject.toml
files) - Or, alternatively, prefer flattening into
[project] scripts.*
entries (current behavior)
Possible Implementation Ideas:
- A CLI flag (e.g.,
--prefer-expanded-tables
) - A configuration setting in
pyproject.toml
forpyproject-fmt
- Default behavior could remain unchanged if no preference is specified
Rationale:
- Improves readability and consistency for users who manually maintain
pyproject.toml
- Reduces diffs when working across teams that expect a particular style
- Enhances user control without sacrificing compliance with PEP 621
Thanks for considering this! I’m happy to help test or contribute if needed.
Olegt0rr
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed