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.62 #3852

Merged
merged 1 commit into from
Dec 10, 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 @@ -25,4 +25,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.61
version: v1.62
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ linters:
- gosmopolitan
- govet
- grouper
- iface
- importas
- ineffassign
- intrange
Expand All @@ -72,6 +73,7 @@ linters:
- promlinter
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
Expand Down
22 changes: 15 additions & 7 deletions cmd/krel/cmd/release_notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,8 @@ func fixReleaseNotes(workDir string, releaseNotes *notes.ReleaseNotes) error {
_, choice, err := util.Ask(fmt.Sprintf("\n- Fix note for PR #%d? (y/N)", note.PrNumber), "y:Y:yes|n:N:no|n", 10)
if err != nil {
// If the user cancelled with ctr+c exit and continue the PR flow
if err.(util.UserInputError).IsCtrlC() {
var userInputErr util.UserInputError
if errors.As(err, &userInputErr) && userInputErr.IsCtrlC() {
logrus.Info("Input cancelled, exiting edit flow")
return nil
}
Expand Down Expand Up @@ -1240,8 +1241,10 @@ func fixReleaseNotes(workDir string, releaseNotes *notes.ReleaseNotes) error {
func pointIfChanged(label string, var1, var2 interface{}) string {
changed := false
// Check if alues are string
if _, ok := var1.(string); ok {
if var1.(string) != var2.(string) {
var1String, ok1 := var1.(string)
var2String, ok2 := var2.(string)
if ok1 && ok2 {
if var1String != var2String {
changed = true
}
}
Expand All @@ -1253,9 +1256,11 @@ func pointIfChanged(label string, var1, var2 interface{}) string {
}
}

// Check if string slices
if _, ok := var1.(bool); ok {
if var1.(bool) != var2.(bool) {
// Check if bools
var1Bool, ok1 := var1.(bool)
var2Bool, ok2 := var2.(bool)
if ok1 && ok2 {
if var1Bool != var2Bool {
changed = true
}
}
Expand Down Expand Up @@ -1458,9 +1463,12 @@ func confirmWithUser(opts *releaseNotesOptions, question string) bool {
_, success, err := util.Ask(question+" (Y/n)", "y:Y:yes|n:N:no|y", 10)
if err != nil {
logrus.Error(err)
if err.(util.UserInputError).IsCtrlC() {

var userInputErr util.UserInputError
if errors.As(err, &userInputErr) && userInputErr.IsCtrlC() {
os.Exit(1)
}

return false
}
if success {
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ dependencies:

# golangci-lint-version
- name: "golangci-lint"
version: v1.61
version: v1.62
refPaths:
- path: .github/workflows/lint.yml
match: "version: v\\d+.\\d+?\\.?(\\d+)?"
Expand Down
4 changes: 3 additions & 1 deletion pkg/cve/cve.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (cve *CVE) ReadRawInterface(cvedata interface{}) error {
if val, ok := cvedata.(map[interface{}]interface{})["linkedPRs"].([]interface{}); ok {
cve.LinkedPRs = []int{}
for _, prid := range val {
cve.LinkedPRs = append(cve.LinkedPRs, prid.(int))
if prid, ok := prid.(int); ok {
cve.LinkedPRs = append(cve.LinkedPRs, prid)
}
}
}

Expand Down
Loading