diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-08-14 13:44:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 13:44:47 +0200 |
commit | f2cd986da07c12e81dd411e4b1190386a6cad750 (patch) | |
tree | 888da2c4550a39d232c705308c638a0c17041e67 | |
parent | 09ffc07fcb9ac2ac99d56b1d2c818ce93e509426 (diff) | |
download | pylint-git-f2cd986da07c12e81dd411e4b1190386a6cad750.tar.gz |
Allow true / false in pylintrc (#4844)
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | pylint/config/option.py | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -130,6 +130,8 @@ Release date: TBA Closes #4839 +* Allow ``true`` and ``false`` values in ``pylintrc`` for better compatibility with ``toml`` config. + What's New in Pylint 2.9.6? =========================== diff --git a/pylint/config/option.py b/pylint/config/option.py index 56aab9628..911287ec6 100644 --- a/pylint/config/option.py +++ b/pylint/config/option.py @@ -35,11 +35,11 @@ def _choice_validator(choices, name, value): def _yn_validator(opt, _, value): if isinstance(value, int): return bool(value) - if value in ("y", "yes"): + if value in ("y", "yes", "true"): return True - if value in ("n", "no"): + if value in ("n", "no", "false"): return False - msg = "option %s: invalid yn value %r, should be in (y, yes, n, no)" + msg = "option %s: invalid yn value %r, should be in (y, yes, true, n, no, false)" raise optparse.OptionValueError(msg % (opt, value)) |