Skip to content

add config-file option#150

Merged
fsouza merged 4 commits intoPyCQA:mainfrom
GrozniyToaster:add_config_file_option
Oct 3, 2022
Merged

add config-file option#150
fsouza merged 4 commits intoPyCQA:mainfrom
GrozniyToaster:add_config_file_option

Conversation

@GrozniyToaster
Copy link
Copy Markdown
Contributor

refer to 149 issue

README.md Outdated
-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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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