Skip to content

Commit 563c744

Browse files
author
Eugene Rossokha
authored
Add blacken-target-version, remove blacken-allow-py36 (#47)
* Add blacken-target-version, remove blacken-allow-py36 * Bring blacken-allow-py36 back
1 parent 880cf50 commit 563c744

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

blacken.el

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;; Author: Artem Malyshev <[email protected]>
66
;; Homepage: https://github.com/proofit404/blacken
7-
;; Version: 0.0.1
7+
;; Version: 0.2.0
88
;; Package-Requires: ((emacs "25.2"))
99
;; SPDX-License-Identifier: GPL-3.0-or-later
1010

@@ -64,6 +64,11 @@ If `fill', the `fill-column' variable value is used."
6464
"Allow using Python 3.6-only syntax on all input files."
6565
:type 'boolean
6666
:safe 'booleanp)
67+
(make-obsolete-variable 'blacken-allow-py36 'blacken-target-version "0.2.0")
68+
69+
(defcustom blacken-target-version nil
70+
"Set the target python version."
71+
:type 'string)
6772

6873
(defcustom blacken-skip-string-normalization nil
6974
"Don't normalize string quotes or prefixes."
@@ -112,8 +117,10 @@ Return black process the exit code."
112117
(number-to-string (cl-case blacken-line-length
113118
('fill fill-column)
114119
(t blacken-line-length)))))
115-
(when blacken-allow-py36
116-
(list "--target-version" "py36"))
120+
(if blacken-allow-py36
121+
(list "--target-version" "py36")
122+
(when blacken-target-version
123+
(list "--target-version" blacken-target-version)))
117124
(when blacken-fast-unsafe
118125
(list "--fast"))
119126
(when blacken-skip-string-normalization

0 commit comments

Comments
 (0)