-
Notifications
You must be signed in to change notification settings - Fork 82
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
Conversation
b46b1c9
to
fb79619
Compare
24c6034
to
231d968
Compare
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
a4c72c9
to
2bc6f1d
Compare
for more information, see https://pre-commit.ci
There was a problem hiding this 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): |
There was a problem hiding this comment.
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:
if getattr(args, "config_file", None): | |
if args.config_file: |
There was a problem hiding this comment.
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'
)
There was a problem hiding this comment.
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.
refer to 149 issue