Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix reading the number argument from config file#923

Merged
ericwb merged 2 commits intoPyCQA:mainfrom
KAUTH:fix-reading-number-argument-from-config-file
Jul 7, 2022
Merged

Fix reading the number argument from config file#923
ericwb merged 2 commits intoPyCQA:mainfrom
KAUTH:fix-reading-number-argument-from-config-file

Conversation

Copy link
Contributor

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
KAUTH requested review from ericwb, lukehinds and sigmavirus24 as code owners July 5, 2022 17:43
ericwb reviewed Jul 6, 2022
Comment on lines 515 to 516
(None if ini_options.get("number") is None
else int(ini_options.get("number"))),
Copy link
Member

ericwb Jul 6, 2022

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

KAUTH Jul 7, 2022

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 requested a review from ericwb July 7, 2022 22:52
ericwb approved these changes Jul 7, 2022
Copy link
Member

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 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

Reviewers

ericwb ericwb approved these changes

lukehinds Awaiting requested review from lukehinds lukehinds is a code owner

sigmavirus24 Awaiting requested review from sigmavirus24 sigmavirus24 is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

2 participants