tox-dev / pyproject-fmt-rust

MIT License
11 stars 7 forks source link

Unexpected comment movement when formatting ruff config #21

Closed adamtheturtle closed 4 months ago

adamtheturtle commented 4 months ago

I had the following ruff configuration:

[tool.ruff.lint]
select = ["ALL"]

ignore = [
    # We do not annotate the type of 'self'.
    "ANN101",
]

# Do not automatically remove commented out code.
# We comment out code during development, and with VSCode auto-save, this code
# is sometimes annoyingly removed.
unfixable = ["ERA001"]

I ran pyproject-fmt 2.1.1.

I got the following (moved into the tool.ruff section):

[tool.ruff]
lint.select = [
    "ALL",
]

lint.unfixable = [
    "ERA001",
]
lint.ignore = [
    # We do not annotate the type of 'self'.
    "ANN101",
]
# Do not automatically remove commented out code.
# We comment out code during development, and with VSCode auto-save, this code
# is sometimes annoyingly removed.

See the comment at the end of the section - that was associated with the unfixable setting, but after the formatting, that association is lost.