-
Notifications
You must be signed in to change notification settings - Fork 36
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
Pass comments generated by lookout-tool review
call to stdout
#601
Comments
There is a limitation in go-log: src-d/go-log#11 |
ping @smola so you are aware of the missing maintainer issue. |
We actually might want to have a JSON poster, alternative to the log one. As we discussed recently, to enable different evaluation and testing use cases. So logs would still go to stderr, but results can be posted as JSON to stdout. |
@smola what is the difference between |
@smacker Logs are written to stdout (no matter the format), while JSON poster would post to stdout. It's kind of differentiating between logging and output. For example: |
But it's true that the log poster could be used, just with a different setup (JSON + stdout) than the general logger? |
We have
This way:
|
If I'm not wrong, this requirement would be satisfied by #624 $ lookout-sdk review --from HEAD^ 2> log.err | wc -l
5
$ lookout-sdk review --from HEAD^ 2> log.err
{"analyzer-name":"","file":"cmd/lookout-sdk/push.go","text":"The file has increased in 2 lines."}
{"analyzer-name":"","file":"cmd/lookout-sdk/push.go","line":27,"text":"This line exceeded 120 chars."}
{"analyzer-name":"","file":"cmd/lookout-sdk/review.go","text":"The file has increased in 2 lines."}
{"analyzer-name":"","file":"cmd/lookout-sdk/review.go","line":23,"text":"This line exceeded 120 chars."}
{"analyzer-name":"","file":"cmd/sdk-test/bblfsh_test.go","line":146,"text":"This line exceeded 120 chars."} |
Imo by default |
Right now I need to parse the lookout-tool logs to get Analyzer comments and rely on internal implementation logic (https://github.com/src-d/lookout/blob/master/server/server.go#L559).
For example something like
go run cmd/lookout-sdk/*.go review --log-format=json 2>&1 | jq 'select(.msg == "file comment")'
can work.I think that comments can be interpreted as
lookout-tool review
output and passed to stdout.It can be in the same log format (JSON/not JSON).
So in ideal case, I just want to run
go run cmd/lookout-sdk/*.go review --log-format=json > comments.json
and get comment per line in JSON format.The text was updated successfully, but these errors were encountered: