Skip to content

Commit 1c3ad72

Browse files
committed
Allow to customize --py36 and -S options.
1 parent d98199e commit 1c3ad72

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

blacken.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
:type 'number
5353
:safe 'numberp)
5454

55+
(defcustom blacken-allow-py36 nil
56+
"Allow using Python 3.6-only syntax on all input files."
57+
:type 'boolean
58+
:safe 'booleanp)
59+
60+
(defcustom blacken-skip-string-normalization nil
61+
"Don't normalize string quotes or prefixes."
62+
:type 'boolean
63+
:safe 'booleanp)
64+
5565
(defun blacken-call-bin (input-buffer output-buffer error-buffer)
5666
"Call process black.
5767
@@ -81,6 +91,10 @@ Return black process the exit code."
8191
(append
8292
(when blacken-line-length
8393
(list "--line-length" (number-to-string blacken-line-length)))
94+
(when blacken-allow-py36
95+
(list "--py36"))
96+
(when blacken-skip-string-normalization
97+
(list "--skip-string-normalization"))
8498
'("-")))
8599

86100
;;;###autoload

0 commit comments

Comments
 (0)