build(deps): bump github.com/go-critic/go-critic from 0.11.2 to 0.11.3 (#4619)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
7f70763697
commit
8f59629bd1
2
go.mod
2
go.mod
@ -38,7 +38,7 @@ require (
|
||||
github.com/firefart/nonamedreturns v1.0.4
|
||||
github.com/fzipp/gocyclo v0.6.0
|
||||
github.com/ghostiam/protogetter v0.3.5
|
||||
github.com/go-critic/go-critic v0.11.2
|
||||
github.com/go-critic/go-critic v0.11.3
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1
|
||||
github.com/go-xmlfmt/xmlfmt v1.1.2
|
||||
github.com/gofrs/flock v0.8.1
|
||||
|
4
go.sum
generated
4
go.sum
generated
@ -151,8 +151,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo=
|
||||
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
|
||||
github.com/ghostiam/protogetter v0.3.5 h1:+f7UiF8XNd4w3a//4DnusQ2SZjPkUjxkMEfjbxOK4Ug=
|
||||
github.com/ghostiam/protogetter v0.3.5/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw=
|
||||
github.com/go-critic/go-critic v0.11.2 h1:81xH/2muBphEgPtcwH1p6QD+KzXl2tMSi3hXjBSxDnM=
|
||||
github.com/go-critic/go-critic v0.11.2/go.mod h1:OePaicfjsf+KPy33yq4gzv6CO7TEQ9Rom6ns1KsJnl8=
|
||||
github.com/go-critic/go-critic v0.11.3 h1:SJbYD/egY1noYjTMNTlhGaYlfQ77rQmrNH7h+gtn0N0=
|
||||
github.com/go-critic/go-critic v0.11.3/go.mod h1:Je0h5Obm1rR5hAGA9mP2PDiOOk53W+n7pyvXErFKIgI=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
|
@ -89,7 +89,7 @@ type InspectionType struct {
|
||||
|
||||
func (i InspectionType) Print(w io.Writer, escaper *strings.Replacer) (int, error) {
|
||||
return fmt.Fprintf(w, "##teamcity[inspectionType id='%s' name='%s' description='%s' category='%s']\n",
|
||||
limit(i.id, smallLimit), limit(i.name, smallLimit), limit(escaper.Replace(i.description), largeLimit), limit(i.category, smallLimit))
|
||||
cutVal(i.id, smallLimit), cutVal(i.name, smallLimit), cutVal(escaper.Replace(i.description), largeLimit), cutVal(i.category, smallLimit))
|
||||
}
|
||||
|
||||
// InspectionInstance reports a specific defect, warning, error message.
|
||||
@ -105,15 +105,15 @@ type InspectionInstance struct {
|
||||
|
||||
func (i InspectionInstance) Print(w io.Writer, replacer *strings.Replacer) (int, error) {
|
||||
return fmt.Fprintf(w, "##teamcity[inspection typeId='%s' message='%s' file='%s' line='%d' SEVERITY='%s']\n",
|
||||
limit(i.typeID, smallLimit),
|
||||
limit(replacer.Replace(i.message), largeLimit),
|
||||
limit(i.file, largeLimit),
|
||||
cutVal(i.typeID, smallLimit),
|
||||
cutVal(replacer.Replace(i.message), largeLimit),
|
||||
cutVal(i.file, largeLimit),
|
||||
i.line, strings.ToUpper(i.severity))
|
||||
}
|
||||
|
||||
func limit(s string, max int) string {
|
||||
func cutVal(s string, limit int) string {
|
||||
var size, count int
|
||||
for i := 0; i < max && count < len(s); i++ {
|
||||
for i := 0; i < limit && count < len(s); i++ {
|
||||
_, size = utf8.DecodeRuneInString(s[count:])
|
||||
count += size
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ func TestTeamCity_Print(t *testing.T) {
|
||||
assert.Equal(t, expected, buf.String())
|
||||
}
|
||||
|
||||
func TestTeamCity_limit(t *testing.T) {
|
||||
func TestTeamCity_cutVal(t *testing.T) {
|
||||
tests := []struct {
|
||||
input string
|
||||
max int
|
||||
@ -100,6 +100,6 @@ func TestTeamCity_limit(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
require.Equal(t, tc.expected, limit(tc.input, tc.max))
|
||||
require.Equal(t, tc.expected, cutVal(tc.input, tc.max))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user