From c6800e0c659eba5b22190bf6ae0ba563a4170661 Mon Sep 17 00:00:00 2001 From: Vadim Nikolaev Date: Thu, 28 Apr 2022 20:17:23 +0500 Subject: [PATCH] Fix strtobool function (#3025) * Fix strtobool function for vim plugin * Update CHANGES.md Co-authored-by: Cooper Lees --- CHANGES.md | 4 ++++ autoload/black.vim | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 566077b1dbc..4cea7fceaad 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -62,6 +62,10 @@ +### Vim Plugin + +- Fixed strtobool function. It didn't parse true/on/false/off. (#3025) + ## 22.3.0 ### Preview style diff --git a/autoload/black.vim b/autoload/black.vim index 66c5b9c2841..6c381b431a3 100644 --- a/autoload/black.vim +++ b/autoload/black.vim @@ -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")