Skip to content

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

Merged
merged 1 commit into from
Jan 12, 2016

Conversation

jpignata
Copy link

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

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)

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

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

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

Copy link
Author

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.

Copy link
Author

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?

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.

Choose a reason for hiding this comment

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

edit: brakeman ref

@ABaldwinHunter
Copy link

One question but LGTM

jpignata added a commit that referenced this pull request Jan 12, 2016
Only output warning in verbose mode
@jpignata jpignata merged commit 8c358dc into jp-code-climate-support Jan 12, 2016
@jpignata jpignata deleted the jp/fix-warning-output branch January 12, 2016 22:09
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.

3 participants