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

add config-file option #150

Merged
merged 4 commits into from
Oct 3, 2022
Merged

Conversation

GrozniyToaster
Copy link
Contributor

refer to 149 issue

README.md Outdated
@@ -121,6 +121,8 @@ options:
-v, --verbose print more verbose logs (you can repeat `-v` to make it more verbose)
--stdin-display-name STDIN_DISPLAY_NAME
the name used when processing input from stdin
--config-file CONFIG_FILE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make it just --config and add tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Collaborator

@fsouza fsouza left a comment

Choose a reason for hiding this comment

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

One last thing, otherwise looks good!

"off": False,
}

if getattr(args, "config_file", None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is an argparse Namespace, we don't need getattr:

Suggested change
if getattr(args, "config_file", None):
if args.config_file:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I also wrote that, but the tests did not pass

Because in most tests the Namespace is passed without the config_file field.

(Crashes with AttributeError: 'Namespace' object has no attribute 'config_file')

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha, I think that's a problem with the tests. I can work on that after merging.

@fsouza fsouza merged commit e2266f3 into PyCQA:main Oct 3, 2022
fsouza added a commit that referenced this pull request Oct 3, 2022
Follow-up from #150.
@fsouza fsouza mentioned this pull request Oct 3, 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.

2 participants