Skip to content

Commit 20308e2

Browse files
author
Your Name
committed
Change code so that if the user sets skip-magic-trailing-comma = 1 in
their black config file, that will be detected by this.
1 parent f8a36d5 commit 20308e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pylsp_black/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def format_text(*, text, config):
8787
line_length=config["line_length"],
8888
is_pyi=config["pyi"],
8989
string_normalization=not config["skip_string_normalization"],
90+
magic_trailing_comma=not config["skip_magic_trailing_comma"],
9091
)
9192
try:
9293
# Black's format_file_contents only works reliably when eols are '\n'. It gives
@@ -131,6 +132,7 @@ def _load_config(filename: str, client_config: Config) -> Dict:
131132
"fast": False,
132133
"pyi": filename.endswith(".pyi"),
133134
"skip_string_normalization": False,
135+
"skip_magic_trailing_comma": False,
134136
"target_version": set(),
135137
"preview": settings.get("preview", False),
136138
}

0 commit comments

Comments
 (0)