8000 Request for Formatting Style Preference Option: `[project.scripts]` vs `[project] scripts.*` · Issue #296 · tox-dev/pyproject-fmt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Request for Formatting Style Preference Option: [project.scripts] vs [project] scripts.* #296
Open
@zappuf

Description

@zappuf

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-written pyproject.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 for pyproject-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0