Skip to content

Commit 66e99d7

Browse files
carnott-snapzeripath
authored andcommitted
upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (#8501)
editorconfig-core-go made breaking api changes and has recently released v2.1.1. This change consumes the new api and fixes up any breaking references.
1 parent 8065502 commit 66e99d7

File tree

23 files changed

+394
-121
lines changed

23 files changed

+394
-121
lines changed

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ require (
2929
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 // indirect
3030
github.com/denisenkom/go-mssqldb v0.0.0-20190924004331-208c0a498538
3131
github.com/dgrijalva/jwt-go v3.2.0+incompatible
32+
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1
3233
github.com/emirpasic/gods v1.12.0
3334
github.com/etcd-io/bbolt v1.3.2 // indirect
3435
github.com/ethantkoenig/rupture v0.0.0-20180203182544-0a76f03a811a
@@ -107,13 +108,11 @@ require (
107108
golang.org/x/tools v0.0.0-20190910221609-7f5965fd7709 // indirect
108109
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
109110
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
110-
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0
111111
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
112112
gopkg.in/ini.v1 v1.48.0
113113
gopkg.in/ldap.v3 v3.0.2
114114
gopkg.in/src-d/go-billy.v4 v4.3.2
115115
gopkg.in/src-d/go-git.v4 v4.13.1
116-
gopkg.in/stretchr/testify.v1 v1.2.2 // indirect
117116
gopkg.in/testfixtures.v2 v2.5.0
118117
mvdan.cc/xurls/v2 v2.1.0
119118
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
134134
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
135135
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
136136
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
137+
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1 h1:mhPg/0hGebcpiiQLqJD2PWWyoHRLEdZ3sXKaEvT1EQU=
138+
github.com/editorconfig/editorconfig-core-go/v2 v2.1.1/go.mod h1:/LuhWJiQ9Gvo1DhVpa4ssm5qeg8rrztdtI7j/iCie2k=
137139
github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
138140
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
139141
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
@@ -522,6 +524,7 @@ github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1
522524
github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w=
523525
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
524526
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
527+
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
525528
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
526529
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
527530
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@@ -763,13 +766,12 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
763766
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
764767
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
765768
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
766-
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0 h1:oxOEwvhxLMpWpN+0pb2r9TWrM0DCFBHxbuIlS27tmFg=
767-
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0/go.mod h1:s2mQFI9McjArkyCwyEwU//+luQENTnD/Lfb/7Sj3/kQ=
768769
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
769770
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
770771
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
771772
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
772773
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
774+
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
773775
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
774776
gopkg.in/ini.v1 v1.44.2/go.mod h1:M3Cogqpuv0QCi3ExAY5V4uOt4qb/R3xZubo9m8lK5wg=
775777
gopkg.in/ini.v1 v1.46.0 h1:VeDZbLYGaupuvIrsYCEOe/L/2Pcs5n7hdO1ZTjporag=
@@ -786,8 +788,6 @@ gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOA
786788
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
787789
gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
788790
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
789-
gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M=
790-
gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU=
791791
gopkg.in/testfixtures.v2 v2.5.0 h1:N08B7l2GzFQenyYbzqthDnKAA+cmb17iAZhhFxr7JHw=
792792
gopkg.in/testfixtures.v2 v2.5.0/go.mod h1:vyAq+MYCgNpR29qitQdLZhdbLFf4mR/2MFJRFoQZZ2M=
793793
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=

modules/context/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"code.gitea.io/gitea/modules/setting"
2020

2121
"gitea.com/macaron/macaron"
22+
"github.com/editorconfig/editorconfig-core-go/v2"
2223
"github.com/unknwon/com"
23-
"gopkg.in/editorconfig/editorconfig-core-go.v1"
2424
)
2525

2626
// PullRequest contains informations to make a pull request

modules/templates/helper.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"code.gitea.io/gitea/services/gitdiff"
3131
mirror_service "code.gitea.io/gitea/services/mirror"
3232

33-
"gopkg.in/editorconfig/editorconfig-core-go.v1"
33+
"github.com/editorconfig/editorconfig-core-go/v2"
3434
)
3535

3636
// NewFuncMap returns functions for injecting to templates
@@ -145,7 +145,11 @@ func NewFuncMap() []template.FuncMap {
145145
},
146146
"TabSizeClass": func(ec *editorconfig.Editorconfig, filename string) string {
147147
if ec != nil {
148-
def := ec.GetDefinitionForFilename(filename)
148+
def, err := ec.GetDefinitionForFilename(filename)
149+
if err != nil {
150+
log.Error("tab size class: getting definition for filename: %v", err)
151+
return "tab-size-8"
152+
}
149153
if def.TabWidth > 0 {
150154
return fmt.Sprintf("tab-size-%d", def.TabWidth)
151155
}

routers/api/v1/repo/file.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func GetEditorconfig(ctx *context.APIContext) {
136136
}
137137

138138
fileName := ctx.Params("filename")
139-
def := ec.GetDefinitionForFilename(fileName)
139+
def, _ := ec.GetDefinitionForFilename(fileName)
140140
if def == nil {
141141
ctx.NotFound(err)
142142
return

vendor/gopkg.in/editorconfig/editorconfig-core-go.v1/.editorconfig renamed to vendor/github.com/editorconfig/editorconfig-core-go/v2/.editorconfig

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/editorconfig/editorconfig-core-go/v2/.gitattributes

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/editorconfig/editorconfig-core-go/v2/.travis.yml

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/editorconfig/editorconfig-core-go/v2/CHANGELOG.md

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/editorconfig/editorconfig-core-go/v2/CMakeLists.txt

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/editorconfig/editorconfig-core-go/v2/Makefile

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/editorconfig/editorconfig-core-go.v1/README.md renamed to vendor/github.com/editorconfig/editorconfig-core-go/v2/README.md

+15-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)