Skip to content

Commit

Permalink
Merge pull request #624 from dpordomingo/stdout
Browse files Browse the repository at this point in the history
Use current json.Poster in sdk, which uses stdout
  • Loading branch information
carlosms authored Apr 18, 2019
2 parents 6949f7b + 3ce7302 commit eab90e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions cmd/lookout-sdk/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import (
"context"
"fmt"
"io"
"os"
"time"

"github.com/src-d/lookout"
"github.com/src-d/lookout/provider/json"
"github.com/src-d/lookout/server"

"gopkg.in/src-d/lookout-sdk.v0/pb"

uuid "github.com/satori/go.uuid"
gocli "gopkg.in/src-d/go-cli.v0"
gogit "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
log "gopkg.in/src-d/go-log.v1"
"gopkg.in/src-d/lookout-sdk.v0/pb"
)

func init() {
Expand Down Expand Up @@ -59,7 +61,7 @@ func (c *PushCommand) Execute(args []string) error {
}

srv := server.NewServer(server.Options{
Poster: &server.LogPoster{Log: log.DefaultLogger},
Poster: json.NewPoster(os.Stdout),
FileGetter: dataHandler.FileGetter,
Analyzers: map[string]lookout.Analyzer{
"test-analyzer": lookout.Analyzer{Client: client},
Expand Down
8 changes: 5 additions & 3 deletions cmd/lookout-sdk/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ package main

import (
"context"
"os"
"time"

"github.com/src-d/lookout"
"github.com/src-d/lookout/provider/json"
"github.com/src-d/lookout/server"

"gopkg.in/src-d/lookout-sdk.v0/pb"

uuid "github.com/satori/go.uuid"
gocli "gopkg.in/src-d/go-cli.v0"
log "gopkg.in/src-d/go-log.v1"
"gopkg.in/src-d/lookout-sdk.v0/pb"
)

func init() {
Expand Down Expand Up @@ -55,7 +57,7 @@ func (c *ReviewCommand) Execute(args []string) error {
}

srv := server.NewServer(server.Options{
Poster: &server.LogPoster{Log: log.DefaultLogger},
Poster: json.NewPoster(os.Stdout),
FileGetter: dataHandler.FileGetter,
Analyzers: map[string]lookout.Analyzer{
"test-analyzer": lookout.Analyzer{Client: client},
Expand Down
4 changes: 2 additions & 2 deletions cmd/sdk-test/bblfsh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (suite *BblfshIntegrationSuite) TestReviewUAST() {

func (suite *BblfshIntegrationSuite) TestReviewLanguage() {
r := suite.RunReview()
suite.GrepTrue(r, `The file has language detected: "Go"`)
suite.GrepTrue(r, `The file has language detected: \"Go\"`)
}

func (suite *BblfshIntegrationSuite) TestPushNoBblfshError() {
Expand Down Expand Up @@ -102,7 +102,7 @@ func (suite *BblfshIntegrationSuite) TestPushUAST() {

func (suite *BblfshIntegrationSuite) TestPushLanguage() {
r := suite.RunPush()
suite.GrepTrue(r, `The file has language detected: "Go"`)
suite.GrepTrue(r, `The file has language detected: \"Go\"`)
}

func (suite *BblfshIntegrationSuite) TestConnectToDataServer() {
Expand Down

0 comments on commit eab90e9

Please sign in to comment.