Skip to content

Commit

Permalink
fix linting (#2555)
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed Jul 22, 2022
1 parent a286510 commit 3764d73
Show file tree
Hide file tree
Showing 44 changed files with 23,064 additions and 4 deletions.
1 change: 0 additions & 1 deletion changeset/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const Unknown = "unknown"
var (
shaRegexp = regexp.MustCompile(`^[a-f0-9]{40,64}$`)
rev string
err error
once sync.Once

readBuildInfo = debug.ReadBuildInfo
Expand Down
5 changes: 4 additions & 1 deletion codegen/cmd/injection-gen/generators/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"sort"
"strings"

"golang.org/x/text/cases"
"golang.org/x/text/language"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/code-generator/cmd/client-gen/generators/util"
clientgentypes "k8s.io/code-generator/cmd/client-gen/types"
Expand Down Expand Up @@ -330,7 +332,8 @@ func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io
if e.IsSubresource() {
opts["Subresource"] = e.SubResourcePath
}
sw.Do(strings.Replace(tmpl, " "+strings.Title(e.VerbType), " "+e.VerbName, -1), opts)
caser := cases.Title(language.English)
sw.Do(strings.Replace(tmpl, " "+caser.String(e.VerbType), " "+e.VerbName, -1), opts)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ require (
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.8
gomodules.xyz/jsonpatch/v2 v2.2.0
google.golang.org/api v0.61.0
Expand Down Expand Up @@ -94,7 +95,6 @@ require (
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
2 changes: 1 addition & 1 deletion test/ghutil/fakeghutil/fakeghutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (fgc *FakeGithubClient) RemoveLabelForIssue(org, repo string, issueNumber i
targetI = i
}
}
if -1 == targetI {
if targetI == -1 {
return fmt.Errorf("cannot find label")
}
targetIssue.Labels = append(targetIssue.Labels[:targetI], targetIssue.Labels[targetI+1:]...)
Expand Down
162 changes: 162 additions & 0 deletions vendor/golang.org/x/text/cases/cases.go

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

Loading

0 comments on commit 3764d73

Please sign in to comment.