grantjenks / blue

The slightly less uncompromising Python code formatter.
https://blue.readthedocs.io/
Other
387 stars 21 forks source link

Don't expand brackets #84

Open thinkwelltwd opened 1 year ago

thinkwelltwd commented 1 year ago

black expands brackets into multiple lines, where this:

raise ValidationError({
    NON_FIELD_ERRORS: [_("Don't do that!")],
})
raise ValidationError(
    {
        NON_FIELD_ERRORS: [_("Don't do that!")],
    }
)

The coalesced bracket version is much to be preferred in my opinion. It would be great to have a configuration option to coalesce rather than expand brackets.