Skip to content

Capture stdout not in json format and raise error #9

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 3 commits into from
Sep 13, 2017

Conversation

filipesperandio
Copy link
Contributor

Errors like this:

$ codeclimate analyze
Starting analysis
Running pmd: Done!
error: (JSON::ParserError) 743: unexpected token at 'Removed misconfigured rule: LoosePackageCoupling  cause: No packages or classes specified '

Become:

$ codeclimate analyze
Starting analysis
Running pmd: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine pmd:beta failed with status 255 and stderr
Removed misconfigured rule: LoosePackageCoupling  cause: No packages or classes specified

System.out.println(line)
} else {
System.err.println(line)
System.exit(-1)

Choose a reason for hiding this comment

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

Might be overly aggressive: it looks like the motivating example here was clearly a log line, and not intended to be an issue. Should we just shunt all these lines to stderr & keep processing?

Optimally we'd like all engines to separate their output streams upstream, but I don't know how feasible that is in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wfleming Yeah, I think it makes sense to redirect those non-issues entries and not abort. I worry a bit about unknown scenarios, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wfleming The problem I see in the CLI is that the user will only have a clue about this warning if CODECLIMATE_DEBUG is on.

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