Skip to content

Commit fba0878

Browse files
committed
1 parent 50d7803 commit fba0878

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Scripts/BlackProcess.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ class BlackProcess {
1111
const maxLineLength =
1212
nova.workspace.config.get("is.flother.Blake.maxLineLength") ??
1313
nova.config.get("is.flother.Blake.maxLineLength");
14+
const previewStyle =
15+
nova.workspace.config.get("is.flother.Blake.blackPreviewStyle") ||
16+
nova.config.get("is.flother.Blake.blackPreviewStyle");
1417
let commandArguments = ["--quiet", "-"];
1518
if (maxLineLength) {
1619
commandArguments = ["--line-length", maxLineLength.toString(), ...commandArguments];
1720
}
21+
if (previewStyle) {
22+
commandArguments = ["--preview", ...commandArguments];
23+
}
1824
if (!blackPath) {
1925
blackPath = "/usr/bin/env";
2026
commandArguments = ["black", ...commandArguments];

config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
"title": "Format Python source code files on save",
4242
"type": "boolean",
4343
"default": false
44+
},
45+
{
46+
"key": "is.flother.Blake.blackPreviewStyle",
47+
"title": "Enable preview style",
48+
"description": "Include experimental style changes",
49+
"link": "https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#preview-style",
50+
"type": "boolean",
51+
"default": false
4452
}
4553
]
4654
}

0 commit comments

Comments
 (0)