Unfortunately, my research in the docs has shown that you cannot configure the ruff formatter to ignore trailing commas. There is a difference between the ruff linter (which you CAN configure to ignore trailing commas using ignore = ["COM812"]
) and the ruff formatter, which is intended to have very limited configuration options.
From https://docs.astral.sh/ruff/formatter/#philosophy:
Like Black, the Ruff formatter does not support extensive code style configuration; however, unlike Black, it does support configuring the desired quote style, indent style, line endings, and more. (See: Configuration.)
This links to https://docs.astral.sh/ruff/formatter/#configuration, which contains nothing for disabling trailing commas.