summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Sadhwani <tushar.sadhwani000@gmail.com>2021-11-13 02:51:09 +0530
committerGitHub <noreply@github.com>2021-11-12 22:21:09 +0100
commit7976857b94146f6ad81ade63797905cd662238c2 (patch)
tree8301ad4ef0375fd292e5eea8f364d227c1c25a4f
parentc62738b66bcbe7220624b04192e9cfe6820ed13a (diff)
downloadpylint-git-7976857b94146f6ad81ade63797905cd662238c2.tar.gz
Make y/n validator case insensitive (#5294)
* Make y/n validator case insensitive * Add changelog entry
-rw-r--r--ChangeLog2
-rw-r--r--doc/whatsnew/2.12.rst2
-rw-r--r--pylint/config/option.py2
3 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1fb2b9a88..253a35fae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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"):