Skip to content
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

Update golangci-lint to v1.56.2 and fix lints #3503

Merged
merged 1 commit into from
Mar 12, 2024
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 .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.55
version: v1.56
args: --timeout=15m
12 changes: 8 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ linters:
- nakedret
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
Expand All @@ -70,6 +69,7 @@ linters:
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
Expand Down Expand Up @@ -113,8 +113,9 @@ linters:
# - noctx
# - nonamedreturns
# - paralleltest
# - testifylint
# - perfsprint
# - tagliatelle
# - testifylint
# - testpackage
# - thelper
# - tparallel
Expand All @@ -123,6 +124,10 @@ linters:
# - wrapcheck
# - wsl
linters-settings:
revive:
rules:
- name: unused-parameter
disabled: true
gocyclo:
min-complexity: 40
godox:
Expand All @@ -144,6 +149,7 @@ linters-settings:
- badLock
- badRegexp
- badSorting
- badSyncOnceFunc
- boolExprSimplify
- builtinShadow
- builtinShadowDecl
Expand Down Expand Up @@ -209,7 +215,6 @@ linters-settings:
- sliceClear
- sloppyLen
- sloppyReassign
- sloppyTestFuncName
- sloppyTypeAssert
- sortSlice
- sprintfQuotedString
Expand All @@ -219,7 +224,6 @@ linters-settings:
- stringsCompare
- switchTrue
- syncMapLoadAndDelete
- timeCmpSimplify
- timeExprSimplify
- todoCommentWithoutDetail
- tooManyResultsChecker
Expand Down
1 change: 0 additions & 1 deletion cmd/krel/cmd/release_notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,6 @@ func editReleaseNote(pr int, workDir string, originalNote, modifiedNote *notes.R
// Verify that the new yaml is valid and can be serialized back into a Map
testMap := notes.ReleaseNotesMap{}
err = yaml.Unmarshal(changes, &testMap)

if err != nil {
logrus.Error("The YAML code has errors")
return true, fmt.Errorf("while verifying if changes are a valid map: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/krel/cmd/sign_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {
}

// TODO: implement me :)
func runSignImages(signOpts *signOptions, args []string) error { //nolint:revive,unparam // keeping the parameters for reference
func runSignImages(signOpts *signOptions, args []string) error { //nolint:unparam // keeping the parameters for reference
logrus.Info("Not implemented")

return nil
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ dependencies:

# golangci-lint-version
- name: "golangci-lint"
version: v1.55
version: v1.56
refPaths:
- path: .github/workflows/lint.yml
match: "version: v\\d+.\\d+?\\.?(\\d+)?"
Expand Down
6 changes: 3 additions & 3 deletions pkg/anago/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func (d *defaultReleaseImpl) ValidateImages(
}

func (d *defaultReleaseImpl) PublishVersion(
buildType, version, buildDir, bucket, gcsRoot string, //nolint: revive,gocritic
versionMarkers []string, //nolint: revive,gocritic
privateBucket, fast bool, //nolint: revive,gocritic
buildType, version, buildDir, bucket, gcsRoot string, //nolint: gocritic
versionMarkers []string, //nolint: gocritic
privateBucket, fast bool, //nolint: gocritic
) error {
return release.
NewPublisher().
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func (bi *Instance) PushContainerImages() error {
// TODO: Investigate if it's worthwhile to use any of the bi.objStore.Get*Path()
//
// functions here or create a new one to populate staging paths
func (bi *Instance) CopyStagedFromGCS(stagedBucket, buildVersion string) error { //nolint:revive // keeping the parameters for reference
func (bi *Instance) CopyStagedFromGCS(stagedBucket, buildVersion string) error {
logrus.Info("Copy staged release artifacts from GCS")

bi.objStore.SetOptions(
Expand Down
2 changes: 1 addition & 1 deletion pkg/notes/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ func (g *Gatherer) notesForCommit(commit *gogithub.RepositoryCommit) (*Result, e
}

// If we found a valid release note, return the PR, otherwise, take the next one
if len(s) > 0 {
if s != "" {
res := &Result{commit: commit, pullRequest: pr}
logrus.Infof("PR #%d seems to contain a release note", pr.GetNumber())
// Do not test further PRs for this commit as soon as one PR matched
Expand Down
Loading