Skip to content

Black Args --line-length 100 is passed with quotes #19413

@haferburg

Description

@haferburg

Issue Type: Bug

I set Black Args to --line-length 100. When black is then triggered by saving a file, I can see in the Output tab that black gets called with
python.exe -m black "--line-length 100" --diff --quiet <filename>

There is no error message, it just doesn't work and nothing happens.

When I do the same on the command line it says "Error: No such option: --line-length 100 Did you mean --line-length?".

The correct way to call black would be without the quotes:
python.exe -m black --line-length 100 --diff --quiet <filename>

As a workaround it's possible to add --line-length and 100 as two separate Black Args.

So I see two issues: 1. The error message from black isn't forwarded to the VS Code user. 2. VS Code shouldn't have added the quotes.

I think this might be a regression, as this has worked previously.

Extension version: 2022.8.1
VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Xeon(R) E-2186M CPU @ 2.90GHz (12 x 2904)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.81GB (20.99GB free)
Process Argv --crash-reporter-id fc9af4af-0143-416b-92ec-5affd7a80523
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdc:30486549

Metadata

Metadata

Assignees

Labels

area-formattingbugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions