Skip to content

Commit 3ffa85e

Browse files
authored
Vendor github.com/braydonk/yaml (google#245)
* Vendor github.com/braydonk/yaml The yaml.v3 package upstream is now archived. This means there is no hope of my patches ever being committed upstream. As such, there is nothing to gain by maintaining this library in a separate repo. It will be easier for people to contribute to if it's in this repo. I will keep github.com/braydonk/yaml alive purely for the select few who pull the package for the couple of patches that upstream never merged. * fix test workflows cause the yaml package fails everything
1 parent 02e5581 commit 3ffa85e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+17647
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ jobs:
5353
run: go mod tidy
5454

5555
- name: Go Vet
56-
run: go vet ./...
56+
run: make vet
5757

5858
- name: Test
59-
run: go test -v ./...
59+
run: make test_v
6060

6161
- name: Integration Test
6262
run: make integrationtest

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ test:
1515

1616
.PHONY: test_v
1717
test_v:
18-
go test -v ./...
18+
@go test -v $$(go list ./... | grep -v "pkg/yaml")
19+
@go test ./pkg/yaml/formattest
20+
21+
.PHONY: vet
22+
vet:
23+
go vet $$(go list ./... | grep -v "pkg/yaml")
1924

2025
YAMLFMT_BIN ?= $(shell pwd)/dist/yamlfmt
2126
.PHONY: integrationtest
@@ -53,10 +58,12 @@ install:
5358
install_tools:
5459
go install github.com/google/addlicense@latest
5560

61+
ADDLICENSE = addlicense -ignore "**/testdata/**" -ignore "**/pkg/yaml/**" -c "Google LLC" -l apache
62+
5663
.PHONY: addlicense
5764
addlicense:
58-
addlicense -ignore "**/testdata/**" -c "Google LLC" -l apache .
65+
$(ADDLICENSE) .
5966

6067
.PHONY: addlicense_check
6168
addlicense_check:
62-
addlicense -check -ignore "**/testdata/**" -c "Google LLC" -l apache .
69+
$(ADDLICENSE) -check .

cmd/yamlfmt/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"strconv"
2525
"strings"
2626

27-
"github.com/braydonk/yaml"
27+
"github.com/google/yamlfmt/pkg/yaml"
2828
"github.com/google/yamlfmt"
2929
"github.com/google/yamlfmt/command"
3030
"github.com/google/yamlfmt/engine"

command/command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323

2424
"github.com/google/yamlfmt"
2525
"github.com/google/yamlfmt/engine"
26+
"github.com/google/yamlfmt/pkg/yaml"
2627
"github.com/mitchellh/mapstructure"
27-
28-
"github.com/braydonk/yaml"
2928
)
3029

3130
type FormatterConfig struct {

docs/config-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ This hotfix is flaky. It is very hard to reconstruct data like this without pars
105105

106106
In addition, while with this feature the `%YAML` directive may work, the formatter very specifically supports only the [YAML 1.2 spec](https://yaml.org/spec/1.2.2/). So the `%YAML:1.0` directive won't have the desired effect when passing a file through `yamlfmt`, and if you have 1.0-only syntax in your document the formatter may end up failing in other ways that will be unfixable.
107107

108-
[1]: https://www.github.com/braydonk/yaml
108+
[1]: ../pkg/yaml/
109109
[Specifying Paths]: ./paths.md

formatters/basic/anchors/check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"errors"
1919
"fmt"
2020

21-
"github.com/braydonk/yaml"
21+
"github.com/google/yamlfmt/pkg/yaml"
2222
)
2323

2424
func Check(n yaml.Node) error {

formatters/basic/anchors/check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strings"
1919
"testing"
2020

21-
"github.com/braydonk/yaml"
21+
"github.com/google/yamlfmt/pkg/yaml"
2222
"github.com/google/yamlfmt/formatters/basic/anchors"
2323
)
2424

formatters/basic/features.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package basic
1616

1717
import (
18-
"github.com/braydonk/yaml"
18+
"github.com/google/yamlfmt/pkg/yaml"
1919
"github.com/google/yamlfmt"
2020
"github.com/google/yamlfmt/formatters/basic/anchors"
2121
"github.com/google/yamlfmt/internal/features"

formatters/basic/formatter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"errors"
2121
"io"
2222

23-
"github.com/braydonk/yaml"
23+
"github.com/google/yamlfmt/pkg/yaml"
2424
"github.com/google/yamlfmt"
2525
"github.com/mitchellh/mapstructure"
2626
)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ go 1.21
44

55
require (
66
github.com/bmatcuk/doublestar/v4 v4.7.1
7-
github.com/braydonk/yaml v0.9.0
87
github.com/google/go-cmp v0.6.0
98
github.com/mitchellh/mapstructure v1.5.0
109
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
1110
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
11+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
1212
)
1313

1414
require golang.org/x/text v0.14.0 // indirect

0 commit comments

Comments
 (0)