Skip to content

Commit

Permalink
Fix strtobool function (#3025)
Browse files Browse the repository at this point in the history
* Fix strtobool function for vim plugin
* Update CHANGES.md

Co-authored-by: Cooper Lees <me@cooperlees.com>
  • Loading branch information
defntvdm and cooperlees committed Apr 28, 2022
1 parent 8ed3e3d commit c6800e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Expand Up @@ -62,6 +62,10 @@

<!-- Changes that improve Black's performance. -->

### Vim Plugin

- Fixed strtobool function. It didn't parse true/on/false/off. (#3025)

## 22.3.0

### Preview style
Expand Down
4 changes: 2 additions & 2 deletions autoload/black.vim
Expand Up @@ -5,9 +5,9 @@ import sys
import vim

def strtobool(text):
if text.lower() in ['y', 'yes', 't', 'true' 'on', '1']:
if text.lower() in ['y', 'yes', 't', 'true', 'on', '1']:
return True
if text.lower() in ['n', 'no', 'f', 'false' 'off', '0']:
if text.lower() in ['n', 'no', 'f', 'false', 'off', '0']:
return False
raise ValueError(f"{text} is not convertable to boolean")

Expand Down

0 comments on commit c6800e0

Please sign in to comment.