Skip to content

build(deps): bump github.com/go-critic/go-critic from 0.11.2 to 0.11.3 #4619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pkg/printers/teamcity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/printers/teamcity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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