Skip to content

Commit

Permalink
Merge 81e59f4 into e5fb9a1
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiNo5 committed Dec 3, 2019
2 parents e5fb9a1 + 81e59f4 commit dde2688
Show file tree
Hide file tree
Showing 56 changed files with 6,136 additions and 4,393 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
@@ -1,25 +1,22 @@
language: go
go:
go:
- 1.x

install:
- go get
- go get github.com/golang/lint/golint
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
- go get github.com/stretchr/testify/assert
- go get github.com/gordonklaus/ineffassign
- go get github.com/fzipp/gocyclo
- go get honnef.co/go/tools/cmd/megacheck
- go get honnef.co/go/tools/cmd/staticcheck

script:
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor | tee /dev/stderr)"
- go vet ./ ./conflate ./example
- golint -set_exit_status ./ ./conflate ./example
- ineffassign ./ ./conflate ./example
- gocyclo -over 15 ./*.go
- megacheck -simple.exit-non-zero=true -staticcheck.exit-non-zero=true -unused.exit-non-zero=true ./ ./conflate ./example
- megacheck -tests=false -simple.enabled=false -staticcheck.enabled=false -unused.exit-non-zero=true ./ ./conflate ./example
- staticcheck --unused.whole-program -show-ignored -fail . ./conflate ./example/
- go test -coverprofile .coverprofile
- $GOPATH/bin/goveralls -v -coverprofile .coverprofile -service=travis-ci

Expand Down
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -20,6 +20,7 @@ Conflate is a library and cli-tool, that provides the following features :
* expand environment variables inside the data
* marshal merged data to multiple formats (JSON/YAML/TOML/go structs)

It supports draft-04, draft-06 and draft-07 of JSON Schema. If the key $schema is missing, or the draft version is not explicitly set, a hybrid mode is used which merges together functionality of all drafts into one mode.
Improvements, ideas and bug fixes are welcomed.

## Getting started
Expand Down Expand Up @@ -71,15 +72,15 @@ $cat ./testdata/valid_parent.json
"valid_child.json",
"valid_sibling.json"
],
"parent_only" : "parent",
"parent_child" : "parent",
"parent_sibling" : "parent",
"parent_only" : "parent",
"parent_child" : "parent",
"parent_sibling" : "parent",
"all": "parent"
}
```

...run the following command, which will merge [valid_parent.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_parent.json),
[valid_child.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_child.json), [valid_sibling.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_sibling.json), :
...run the following command, which will merge [valid_parent.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_parent.json),
[valid_child.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_child.json), [valid_sibling.json](https://raw.githubusercontent.com/miracl/conflate/master/testdata/valid_sibling.json) :

```bash
$conflate -data ./testdata/valid_parent.json -format JSON
Expand Down Expand Up @@ -165,7 +166,7 @@ $conflate -data ./testdata/valid_child.json -data ./testdata/valid_sibling.json
Or alternatively, you can create a top-level JSON file containing only the `includes` array. For fun, lets choose to use YAML for the top-level file, and output TOML :
```bash
$cat toplevel.yaml
$cat toplevel.yaml
includes:
- testdata/valid_child.json
- testdata/valid_sibling.json
Expand Down Expand Up @@ -194,7 +195,7 @@ $echo 'all="MY OVERRIDDEN VALUE"' | conflate -data ./testdata/valid_parent.json
}
```
Note that in all cases `-data` sources are processed from left-to-right, with values in right files overriding values in left files, so the following doesnt work :
Note that in all cases `-data` sources are processed from left-to-right, with values in right files overriding values in left files, so the following doesn't work :
```bash
$echo 'all="MY OVERRIDDEN VALUE"' | conflate -data stdin -data ./testdata/valid_parent.json -format JSON
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.0.0
0.1.0
14 changes: 14 additions & 0 deletions go.mod
@@ -0,0 +1,14 @@
module github.com/miracl/conflate

go 1.13

require (
github.com/BurntSushi/toml v0.3.1
github.com/ghodss/yaml v1.0.0
github.com/stretchr/testify v1.3.0
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/net v0.0.0-20191125084936-ffdde1057850
gopkg.in/yaml.v2 v2.2.7 // indirect
)
28 changes: 28 additions & 0 deletions go.sum
@@ -0,0 +1,28 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20191125084936-ffdde1057850 h1:Vq85/r8R9IdcUHmZ0/nQlUg1v15rzvQ2sHdnZAj/x7s=
golang.org/x/net v0.0.0-20191125084936-ffdde1057850/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 comments on commit dde2688

Please sign in to comment.