Skip to content

build(deps): bump github.com/alexkohler/nakedret to 2.0.1 #3760

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
merged 5 commits into from
Apr 14, 2023
Merged

build(deps): bump github.com/alexkohler/nakedret to 2.0.1 #3760

merged 5 commits into from
Apr 14, 2023

Conversation

zalenskivolt
Copy link
Contributor

Handling of naked returns inside conditionals as well as from nested functions has been added upstream, in alexkohler/nakedret#12 and more commits.

This should resolve #1317.

@boring-cyborg
Copy link

boring-cyborg bot commented Apr 3, 2023

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Apr 3, 2023

CLA assistant check
All committers have signed the CLA.

@ldez ldez added blocked Need's direct action from maintainer linter: update Update the linter implementation inside golangci-lint labels Apr 3, 2023
@ldez ldez self-requested a review April 3, 2023 22:50
@ldez
Copy link
Member

ldez commented Apr 4, 2023

Hello,

the way that we handle this linter is not right, we have to change that.

Instead of "duplicating" the code inside golangci-lint I think it's better to a create PR on nakedret to be able to use it as a dependency.

Handling of naked returns inside conditionals as well as from nested functions has been added upstream,
in alexkohler/nakedret#12 and more commits.

This should resolve #1317.
@zalenskivolt
Copy link
Contributor Author

zalenskivolt commented Apr 11, 2023

Instead of "duplicating" the code inside golangci-lint I think it's better to a create PR on nakedret to be able to use it as a dependency.

This was updated in alexkohler/nakedret#25 and now this PR uses that analyzer directly!

@zalenskivolt
Copy link
Contributor Author

@ldez linter is updated, and should not be blocked any more! 😄

@ldez ldez added enhancement New feature or improvement and removed blocked Need's direct action from maintainer labels Apr 12, 2023
@zalenskivolt zalenskivolt changed the title Update nakedret.go from upstream Update nakedret.go using analyzer from upstream Apr 13, 2023
@ldez ldez changed the title Update nakedret.go using analyzer from upstream build(deps): bump github.com/alexkohler/nakedret to 2.0.1 Apr 14, 2023
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 8f8c68a into golangci:master Apr 14, 2023
@zalenskivolt zalenskivolt deleted the patch-1 branch April 14, 2023 10:26
Comment on lines +8 to +11
return // want "naked return in func `NakedretIssue` with 33 lines of code"
}

fmt.Println("nakedret")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ldez were these fmt.Println() updates intentional?

should it still test the edge case of 31 lines, by removing two // ... lines below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the println is intentional, because I wanted to have at least one std import.

@ldez ldez added this to the v1.53 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement linter: update Update the linter implementation inside golangci-lint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nakedret doesn't check "return"s in conditionals
3 participants