79333994

Date: 2025-01-06 18:40:11
Score: 1
Natty:
Report link

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.

Reasons:
  • Blacklisted phrase (1): This link
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: wames