-
Notifications
You must be signed in to change notification settings - Fork 7
Only output warning in verbose mode #1
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
Conversation
If a user has an invalid configuration option in their local pep8 config file, a warning is emitted to STDOUT causing Code Climate to error the build when it tries to parse the output as an issue. For now only output this warning when pep8 is running in verbose mode. Eventually this should likely output a warning item when using the Code Climate formatter.
@@ -2061,7 +2061,8 @@ def read_config(options, args, arglist, parser): | |||
# Second, parse the configuration | |||
for opt in config.options(pep8_section): | |||
if opt.replace('_', '-') not in parser.config_options: | |||
print(" unknown option '%s' ignored" % opt) | |||
if options.verbose: | |||
print(" unknown option '%s' ignored" % opt) |
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.
does the order of encountering arguments matter? (e.g. verbose coming after unknown variable?)
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.
Also, I saw one support issue where a user's config verbose
settings.
https://secure.helpscout.net/search/convos/?query=pep8
We probably want to add --quiet
to docker command
https://github.com/codeclimate/pep8/blob/jp-code-climate-support/Dockerfile#L13
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.
It seems sensible to output this to stderr instead of stdout as well (or instead of)?
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.
@wfleming Yeah, I wanted to do that instead, but that seemed a deeper change and I was concerned about 2/3 compatibility so I punted for now. Since the surrounding code checks verbose
for informational messages I think this is sufficient for now.
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.
@ABaldwinHunter Are you sure --quiet
accomplishes negating the verbose configuration?
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.
Alack no, I tested it out locally last week and it didn't seem to override the config option.
Requires a bit more digging, but seems on right track.
We use --quiet
in a couple of other engines I think, including brakeman.
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.
edit: brakeman ref
One question but LGTM |
Only output warning in verbose mode
If a user has an invalid configuration option in their local pep8 config
file, a warning is emitted to STDOUT causing Code Climate to error the
build when it tries to parse the output as an issue.
For now only output this warning when pep8 is running in verbose mode.
Eventually this should likely output a warning item when using the Code
Climate formatter.
@codeclimate/review