Skip to content

Commit

Permalink
Handle floats when parsing pyproject.toml (pylint-dev#4518)
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Siebenhaar committed May 28, 2021
1 parent 6d449f9 commit c5cd391
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,5 @@ contributors:
* Bernard Nauwelaerts: contributor

* Fabian Damken: contributor

* Markus Siebenhaar: contributor
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ modules are added.

Closes #585

* Added handling of floating point values when parsing configuration from pyproject.toml

Closes #4518

What's New in Pylint 2.8.2?
===========================
Expand Down
2 changes: 2 additions & 0 deletions doc/whatsnew/2.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ Other Changes
like ``[]`` and ``[1, 2, 3]``.

* ``ignore-paths`` configuration directive has been added. Defined regex patterns are matched against file path.

* Added handling of floating point values when parsing configuration from pyproject.toml
2 changes: 1 addition & 1 deletion pylint/config/option_manager_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def read_config_file(self, config_file=None, verbose=None):
for option, value in values.items():
if isinstance(value, bool):
values[option] = "yes" if value else "no"
elif isinstance(value, int):
elif isinstance(value, (int, float)):
values[option] = str(value)
elif isinstance(value, list):
values[option] = ",".join(value)
Expand Down

0 comments on commit c5cd391

Please sign in to comment.