ruff
b1c4c7be - Add trailing comma for single-element import-from groups (#6583)

Commit
2 years ago
Add trailing comma for single-element import-from groups (#6583) ## Summary Unlike other statements, Black always adds a trailing comma if an import-from statement breaks with a single import member. I believe this is for compatibility with isort -- see https://github.com/psf/black/commit/09f5ee3a19f4274bb848324867bd8e68724cf851, https://github.com/psf/black/issues/127, or https://github.com/psf/black/blob/66648c528a95553c1f822ece394ac98784baee47/src/black/linegen.py#L1452 for the current version. ## Test Plan `cargo test`, notice that a big chunk of the compatibility suite is removed. Before: | project | similarity index | |--------------|------------------| | cpython | 0.75472 | | django | 0.99804 | | transformers | 0.99618 | | twine | 0.99876 | | typeshed | 0.74233 | | warehouse | 0.99601 | | zulip | 0.99727 | After: | project | similarity index | |--------------|------------------| | cpython | 0.75472 | | django | 0.99804 | | transformers | 0.99618 | | twine | 0.99876 | | typeshed | 0.74260 | | warehouse | 0.99601 | | zulip | 0.99727 |
Author
Parents
Loading