Skip to content

Commit 4f8ab69

Browse files
sieharMarkus Siebenhaarpre-commit-ci[bot]
authored
Handle floats when parsing pyproject.toml (#4518) (#4520)
* Handle floats when parsing pyproject.toml (#4518) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Markus Siebenhaar <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6d449f9 commit 4f8ab69

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CONTRIBUTORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,3 +499,5 @@ contributors:
499499
* Bernard Nauwelaerts: contributor
500500

501501
* Fabian Damken: contributor
502+
503+
* Markus Siebenhaar: contributor

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ modules are added.
105105

106106
Closes #585
107107

108+
* Added handling of floating point values when parsing configuration from pyproject.toml
109+
110+
Closes #4518
111+
108112

109113
What's New in Pylint 2.8.2?
110114
===========================

doc/whatsnew/2.9.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ Other Changes
5555
like ``[]`` and ``[1, 2, 3]``.
5656

5757
* ``ignore-paths`` configuration directive has been added. Defined regex patterns are matched against file path.
58+
59+
* Added handling of floating point values when parsing configuration from pyproject.toml

pylint/config/option_manager_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def read_config_file(self, config_file=None, verbose=None):
281281
for option, value in values.items():
282282
if isinstance(value, bool):
283283
values[option] = "yes" if value else "no"
284-
elif isinstance(value, int):
284+
elif isinstance(value, (int, float)):
285285
values[option] = str(value)
286286
elif isinstance(value, list):
287287
values[option] = ",".join(value)

0 commit comments

Comments
 (0)