Skip to content

Commit

Permalink
vendor: add bblfsh client as dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Molina <[email protected]>
  • Loading branch information
erizocosmico committed Apr 10, 2018
1 parent 9cd6912 commit ede362b
Show file tree
Hide file tree
Showing 759 changed files with 515,423 additions and 10 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
language: go
sudo: required

go:
- 1.9
- tip

<<<<<<< HEAD
go_import_path: github.com/src-d/gitbase
=======
services:
- docker

go_import_path: github.com/src-d/gitbase
>>>>>>> internal/function: implement uast and uast_xpath functions

matrix:
fast_finish: true
allow_failures:
- go: tip

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6

install:
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
- cd ./vendor/gopkg.in/bblfsh/client-go.v2
- make dependencies
- cd ./../../../..
- make dependencies

before_script:
- docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd
- docker exec -it bblfshd bblfshctl driver install --all

script:
- make test-coverage codecov
Expand Down
76 changes: 73 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@
[[constraint]]
name = "gopkg.in/src-d/enry.v1"
version = "1.6.3"

[[constraint]]
name = "gopkg.in/bblfsh/client-go.v2"
version = "2.4.1"
8 changes: 8 additions & 0 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ func getBoolEnv(key string, defaultValue bool) bool {

return defaultValue
}

func getStringEnv(key string, defaultValue string) string {
v, ok := os.LookupEnv(key)
if !ok {
return defaultValue
}
return v
}
3 changes: 3 additions & 0 deletions internal/function/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package function

import "gopkg.in/src-d/go-mysql-server.v0/sql"

// Functions for gitbase queries.
var Functions = sql.Functions{
"is_tag": sql.Function1(NewIsTag),
"is_remote": sql.Function1(NewIsRemote),
"commit_has_blob": sql.Function2(NewCommitHasBlob),
"history_idx": sql.Function2(NewHistoryIdx),
"commit_has_tree": sql.Function2(NewCommitHasTree),
"language": sql.FunctionN(NewLanguage),
"uast": sql.FunctionN(NewUAST),
"uast_xpath": sql.Function2(NewUASTXPath),
}
Loading

0 comments on commit ede362b

Please sign in to comment.