Skip to content

Exit on error with proper error format #17

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
May 18, 2017
Merged

Conversation

chrishulton
Copy link
Contributor

@chrishulton chrishulton commented May 16, 2017

For some reason this was printing errors in a JSON format similar to the issue format and not exiting, leading to the CLI trying to parse the error as an issue and erroring.

Before:

Starting analysis
Running golint: Failed

Analysis failed with the following output:
golint:stable produced invalid output: Category must be at least one of Bug Risk, Clarity,
Compatibility, Complexity, Duplication, Performance, Security, Style; Check name must be pr
esent; Location is not formatted correctly; Path must be relative to the project directory;
 Type must be 'issue' but was 'warning': `{"type"=>"warning", "description"=>"Could not lin
t file (/code/foo.go:1:1: expected 'package', found 'EOF')", "location"=>{"path"=>"/code/fo
o.go"}}`.

After:

Starting analysis
Running golint: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine golint:stable failed with status 1 and stderr
Could not lint file: /code/foo.go
Error /code/foo.go:1:1: expected 'package', found 'EOF'

This makes the engine consistent with gofmt.

@chrishulton chrishulton requested a review from wfleming May 16, 2017 20:56
@chrishulton chrishulton merged commit 9ffe218 into master May 18, 2017
@chrishulton chrishulton deleted the chris/fix-error-format branch May 18, 2017 14:43
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