From 1d7260050d846d2ba2dd5bb22944b032245c7e51 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 15 Nov 2021 19:03:47 -0800 Subject: [PATCH] vim: Parse skip_magic_trailing_comma from pyproject.toml (#2613) Co-authored-by: Kyle Kovacs --- CHANGES.md | 1 + autoload/black.vim | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c565fbe..4e99c94 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ ### Integrations - Fixed vim plugin with Python 3.10 by removing deprecated distutils import (#2610) +- The vim plugin now parses `skip_magic_trailing_comma` from pyproject.toml (#2613) ## 21.10b0 diff --git a/autoload/black.vim b/autoload/black.vim index 6c3bbfe..66c5b9c 100644 --- a/autoload/black.vim +++ b/autoload/black.vim @@ -29,6 +29,7 @@ FLAGS = [ Flag(name="fast", cast=strtobool), Flag(name="skip_string_normalization", cast=strtobool), Flag(name="quiet", cast=strtobool), + Flag(name="skip_magic_trailing_comma", cast=strtobool), ] @@ -143,6 +144,7 @@ def Black(**kwargs): line_length=configs["line_length"], string_normalization=not configs["skip_string_normalization"], is_pyi=vim.current.buffer.name.endswith('.pyi'), + magic_trailing_comma=not configs["skip_magic_trailing_comma"], **black_kwargs, ) quiet = configs["quiet"] -- 2.39.5