diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..cc7cef4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,37 @@ +# Golang CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-go/ for more details +version: 2 +jobs: + build: + docker: + # specify the version + - image: circleci/golang:1.8 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/postgres:9.4 + + #### TEMPLATE_NOTE: go expects specific checkout path representing url + #### expecting it in the form of + #### /go/src/github.com/circleci/go-tool + #### /go/src/bitbucket.org/circleci/go-tool + working_directory: /go/src/otremblay.com/jkl + steps: + - checkout + + # specify any bash command here prefixed with `run: ` + - run: go get github.com/golang/dep/cmd/dep + - run: go vet ./... + - run: dep ensure + - run: + command: + go test $(go list ./... | grep -v /vendor/) + - run: go install $(go list ./... | grep -v /vendor/) + - run: + command: | + cp /go/bin/jkl /tmp/jkl + - store_artifacts: + path: /tmp/jkl + destination: jkl diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json deleted file mode 100644 index c1fa090..0000000 --- a/Godeps/Godeps.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ImportPath": "github.com/avanier/jkl", - "GoVersion": "go1.8", - "GodepVersion": "v79", - "Deps": [ - { - "ImportPath": "github.com/joho/godotenv", - "Comment": "v1.1-23-gc9360df", - "Rev": "c9360df4d16dc0e391ea2f28da2d31a9ede2e26f" - } - ] -} diff --git a/Godeps/Readme b/Godeps/Readme deleted file mode 100644 index 4cdaa53..0000000 --- a/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..a80820b --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,33 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/hanwen/go-fuse" + packages = ["fuse","fuse/nodefs","fuse/pathfs","splice"] + revision = "5690be47d614355a22931c129e1075c25a62e9ac" + version = "v20170619" + +[[projects]] + name = "github.com/joho/godotenv" + packages = ["."] + revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b" + version = "v1.2.0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + revision = "541b9d50ad47e36efd8fb423e938e59ff1691f68" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix","windows"] + revision = "8dbc5d05d6edcc104950cc299a1ce6641235bc86" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "e645477fd4358a3de6784ff29e9a1c0f3e3f12379ce0600519ab4e19de48c88a" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..63e91da --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,34 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + + +[[constraint]] + name = "github.com/hanwen/go-fuse" + version = "20170619.0.0" + +[[constraint]] + name = "github.com/joho/godotenv" + version = "1.2.0" + +[[constraint]] + branch = "master" + name = "golang.org/x/crypto" diff --git a/cmd/jkl/editor_test.go b/cmd/jkl/editor_test.go index 35aa64f..b9a9745 100644 --- a/cmd/jkl/editor_test.go +++ b/cmd/jkl/editor_test.go @@ -12,7 +12,7 @@ hell Issue Type: Sometype this is ignored Summary: Dookienator -also ignored`, "\n")) +also ignored`, "\n"), nil) AssertEqual(t, `Cowboys from hell`, iss.Fields.Description) diff --git a/cmd/jklfs/jklfile.go b/cmd/jklfs/jklfile.go index ad5bbc3..e34d3fc 100644 --- a/cmd/jklfs/jklfile.go +++ b/cmd/jklfs/jklfile.go @@ -32,7 +32,7 @@ func (f *jklfile) String() string { func (f *jklfile) Write(data []byte, off int64) (uint32, fuse.Status) { n, err := f.File.WriteAt(data, off) if err != nil { - return uint32(0),fuse.EACCES + return uint32(0), fuse.EACCES } return uint32(n), fuse.OK } @@ -76,3 +76,7 @@ func (f *jklfile) SetInode(i *nodefs.Inode) {} func (f *jklfile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status { return fuse.EPERM } + +func (f *jklfile) Flock(flags int) fuse.Status { + return fuse.ENOSYS +} diff --git a/jkl_test.go b/jkl_test.go index 70f796c..d1665bd 100644 --- a/jkl_test.go +++ b/jkl_test.go @@ -1,34 +1,11 @@ package jkl import ( - "encoding/json" - "fmt" "os" "testing" "text/template" ) -func TestUnmarshalProjects(t *testing.T) { - f, err := os.Open("projects.json") - if err != nil { - t.Error(err) - } - dec := json.NewDecoder(f) - x := struct{ Projects []Project }{} - - err = dec.Decode(&x) - if err != nil { - t.Error(err) - } - for _, p := range x.Projects { - for _, it := range p.IssueTypes { - for sn, f := range it.Fields { - fmt.Println(it.Name, sn, f.Name, f.Required, f.Schema.Type) - } - } - } -} - type TestType struct { Field string }