Hi there,
yapf has a feature which I'm missing a lot in black. In yapf you can disable formatting for single expressions, e.g.:
def bar():
query, values = sql( # yapf: disable
SELECT, "*",
FROM, records,
WHERE,
records.intcol.eq(1), OR,
records.jsonbcol.foo[0].eq(2),
)
# Here yapf is enabled again.
# ...
d = { # yapf: disable
"name": "peter",
"item1": "foo", "item2": "bar", "item3": "baz",
}
# Here yapf is enabled again.
# ...
This helps a lot in various situations.
Any love for this? :)
Do you know about the # fmt: off / # fmt: on feature?
Yes :)
I would really love this, primarily for the following case:
import pdb; pdb.set_trace() # fmt: off-line
Update, I see https://github.com/psf/black/issues/790 addresses my specific use case:
__import__("pdb").set_trace() # FIXME
Most helpful comment
Do you know about the
# fmt: off/# fmt: onfeature?