From: Ɓukasz Langa Date: Mon, 28 Oct 2019 23:50:42 +0000 (+0100) Subject: Re-implement magic trailing comma handling: X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/788268bc39a87d37a24d203fa5ee7b3953af3446?ds=inline;hp=788268bc39a87d37a24d203fa5ee7b3953af3446 Re-implement magic trailing comma handling: - when a trailing comma is specified in any bracket pair, that signals to Black that this bracket pair needs to be always exploded, e.g. presented as "one item per line"; - this causes some changes to previously formatted code that erroneously left trailing commas embedded into single-line expressions; - internally, Black needs to be able to identify trailing commas that it put itself compared to pre-existing trailing commas. We do this by using/abusing lib2to3's `was_checked` attribute. It's True for internally generated trailing commas and False for pre-existing ones (in fact, for all pre-existing leaves and nodes). Fixes #1288 ---