diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/whatsnew/2.12.rst | 2 | ||||
-rw-r--r-- | pylint/config/option.py | 2 |
3 files changed, 6 insertions, 0 deletions
@@ -158,6 +158,8 @@ Release date: TBA Closes #5208 +* Make yn validator case insensitive, to allow for ``True`` and ``False`` in config files. + What's New in Pylint 2.11.2? ============================ diff --git a/doc/whatsnew/2.12.rst b/doc/whatsnew/2.12.rst index 76b08846f..919371046 100644 --- a/doc/whatsnew/2.12.rst +++ b/doc/whatsnew/2.12.rst @@ -156,3 +156,5 @@ Other Changes have functioning shared semaphore implementation. Closes #5216 + +* Make yn validator case insensitive, to allow for ``True`` and ``False`` in config files. diff --git a/pylint/config/option.py b/pylint/config/option.py index 7b3e3b1b1..706b7a4af 100644 --- a/pylint/config/option.py +++ b/pylint/config/option.py @@ -50,6 +50,8 @@ def _choice_validator(choices, name, value): def _yn_validator(opt, _, value): if isinstance(value, int): return bool(value) + if isinstance(value, str): + value = value.lower() if value in ("y", "yes", "true"): return True if value in ("n", "no", "false"): |