astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
32.38k stars 1.08k forks source link

Default `isort.split-on-trailing-comma` to `format.skip-magic-trailing-comma` #9006

Open sbrugman opened 11 months ago

sbrugman commented 11 months ago

For our PyCodeHash project we have turned magic trailing comma off:

[tool.ruff.isort]
split-on-trailing-comma = false

[tool.ruff.format]
skip-magic-trailing-comma = true

Now I see that in this commit we default max-positional-args to max-args.

What do you think about defaulting isort.split-on-trailing-comma to format.skip-magic-trailing-comma (or vice versa)?

MichaReiser commented 11 months ago

Hy @sbrugman

I can see how keeping the two settings consistent can be annoying.

We do inherit values in other places but so far only from top-level to a tool specific configuration and not across different tools, because we could only inherit one way (isort from format, or format from isort) or explaining the default value might get confusing.

What we have done so far is to make tool specific options global options with tool-specific overrides (which may not even be necessary?). The downside of this is that it complicates configuration inheritance (using extends) and it may result in many global options.

That's why I'm not sure what the best approach here is, but I agree that having a consistent solution for this kind of problem would improve usability.