astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Two spaces for indentation level of pyproject.toml #1078

Open my1e5 opened 4 months ago

my1e5 commented 4 months ago

Currently rye uses 4 spaces for indentation levels when working with pyproject.toml.

While it is not explicitly stated, the examples in the official TOML specification use two spaces for indentation levels.

See https://toml.io/en/v1.0.0#array imageimage

Many popular TOML formatting tools also use 2 spaces for their default indentation value.

image

image

Would rye be open to setting two spaces as the default indentation? Or perhaps making it configurable?

mitsuhiko commented 2 months ago

I'm open to it but I'm not sure what the pyproject.toml recommendations are.

zanieb commented 2 months ago

I don't see a specific recommendation, but they do use two spaces in the docs https://packaging.python.org/en/latest/guides/writing-pyproject-toml/