COM812
with black --preview
#4213
Replies: 2 comments 2 replies
-
Thanks for bringing this up. I'm not very familiar with the rule nor black, so forgive me for the basic question. From the black documentation
|
Beta Was this translation helpful? Give feedback.
-
I believe the changes that Black makes were reverted in psf/black#3640 as the change was "too destructive based on feedback" to make it into the 2024 stable style. |
Beta Was this translation helpful? Give feedback.
-
With
black==23.3.0
andruff==0.0.264
and the below snippet:Running
black --preview a.py
, no changes.Next running
ruff --fixable=COM812 --select=COM812 --fix a.py
, it adds the trailing comma:Now running
black --preview a.py
again, we seeblack
adds an extra set of parenthesis, and wrapped the text at 88-chars with the space up front (per this comment):The file has now stabilized with respect to both
black
andruff
. The end result is that:black
spaced over 4 characters for an enclosing()
black
's--experimental-string-processing
(part of--preview
) wrapped the text overAt first thought, this seems like
COM812
andblack --preview
results in wasting of whitespace.What do you think? Is there anything we can do here?
I am thinking about disabling
COM812
so I can useblack --preview
and not have this churn.Beta Was this translation helpful? Give feedback.
All reactions