Skip to content

Commit

Permalink
Handle floats when parsing pyproject.toml (#4518) (#4520)
Browse files Browse the repository at this point in the history
* 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 <markus.siebenhaar@masiha.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed May 29, 2021
1 parent 6d449f9 commit 4f8ab69
Show file tree
Hide file tree
Showing 4 changed files with 9 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
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ 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 4f8ab69

Please sign in to comment.