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 to Go 1.18 and update GolangCI Linter #672

Merged
merged 16 commits into from
Apr 16, 2022
Merged

Conversation

christopher-henderson
Copy link
Member

@christopher-henderson christopher-henderson commented Apr 9, 2022

sigh golangci broke itself and began to fail to compile which forced an upgrade to a version that added just a ton of useless and asinine lints.

@christopher-henderson christopher-henderson changed the title Upgrding the repo to Go 1.18 GolangCI linter is broken Apr 9, 2022
@@ -33,6 +33,7 @@ linters:
- goconst
- golint
- godot
- forbidigo
Copy link
Member Author

@christopher-henderson christopher-henderson Apr 11, 2022

Choose a reason for hiding this comment

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

forbidgo is profoundly useless. It literally bans certain regexes from your codebase - notable any use of fmt.Print(f|ln) (because I guess it's illegal to print to stdout without a logging framework?)

@zakird
Copy link
Member

zakird commented Apr 15, 2022

@christopher-henderson I didn't merge this tests seemed to be failing (and now merge conflict). I can if we need to force it through (post merge)

@christopher-henderson christopher-henderson changed the title GolangCI linter is broken Update to Go 1.18 and update GolangCI Linter Apr 16, 2022
@christopher-henderson
Copy link
Member Author

christopher-henderson commented Apr 16, 2022

Thanks you so much @zakird for hopping on a batch of topics yesterday 🙏

This one...this one is getting an exasperated sigh from me. Master is broken because the linter itself no longer works and requires an upgrade (including an upgrade to Go 1.18 which is all well and good).

Unfortunately, the linter update is coming bundled with an absolute ocean of useless and frankly, idiotic, lints. For example, the variable ip no longer appears to be good enough for the linter (it is clearly requiring that anything with a global scope have a minimum name length which is...naive). And this is not a warning, the variable ip is a full on error.

So I'm fighting the urge to blindly disable this thing and pecking through its demands.

EDIT:

I am truly stunned. ireturn considers it a hard error to return an interface type. paralleltest considers it an error if a test is not ran in parellel.

And behold their king and ruler, nlreturn, whose docs declare that the following is a hard error...

func foo() int {
    a := 0
    _ = a
    return a
}

Apparently "correct" code is...

func foo() int {
    a := 0
    _ = a

    return a
}

I am suddenly finding myself wishing that GitHub had a downvote option.

@zakird
Copy link
Member

zakird commented Apr 16, 2022 via email

@christopher-henderson christopher-henderson merged commit 74f4541 into master Apr 16, 2022
@christopher-henderson christopher-henderson deleted the go18update branch April 16, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants