Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading the number argument from config file #923

Merged

Conversation

KAUTH
Copy link
Contributor

@KAUTH KAUTH commented Jul 5, 2022

When passing the "number" option from the INI file we did
not take into account to store its value as an integer
(when that value is not None).

Resolves: #922

When passing the "number" option from the INI file we did
not take into account to store its value as an integer
(when that value is not None).

Resolves: PyCQA#922
Comment on lines 515 to 516
(None if ini_options.get("number") is None
else int(ini_options.get("number"))),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(None if ini_options.get("number") is None
else int(ini_options.get("number"))),
int(ini_options.get("number") or 0) or None,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, much cleaner!

We use the "or" boolean operation to have a
cleaner implementation of the solution.
@KAUTH KAUTH requested a review from ericwb July 7, 2022 22:52
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericwb ericwb merged commit 39cdfab into PyCQA:main Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command line argument "number" cannot be supplied from the INI file
2 participants