-
Notifications
You must be signed in to change notification settings - Fork 357
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
chore: upgrade golangci linter to 1.57.2 #9279
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9279 +/- ##
==========================================
- Coverage 49.00% 49.00% -0.01%
==========================================
Files 1234 1234
Lines 159693 159652 -41
Branches 2781 2781
==========================================
- Hits 78259 78235 -24
+ Misses 81259 81242 -17
Partials 175 175
Flags with carried forward coverage won't be shown. Click here to find out more.
|
821abe4
to
7dbdd86
Compare
a04212f
to
94d69e3
Compare
619707e
to
0225208
Compare
763c744
to
259a551
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for making all these changes - I'm really excited about it; I think it cleans up a lot of nits in the code making it more idiomatic and easier to debug/reason about.
d2a7710
to
94e3b86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked the config changes, and a random sample of the files. Thank you!
Ticket
RM-169
Description
Upgrade the golangci linter to version 1.57.2.
Includes the following changes (not exhaustive):
close
should be renamed tocloseDB
).require
statments, require that theexpected
value come before theactual
.if cond{foo()} return bar
, replace this withif !cond {return bar} foo()
.break
s in case clauses.*Ids
should be renamed to*IDs
.Additionally, whenever I came across cases of
errors.New(...)
in files I was already changing, I replaced these withfmt.Errorf(...)
-- as this is best practice, in our pursuit to remove the errors pkg from our code base. I didn't go out of my way to replace all instances oferrors.New
as I wanted to limit the scope of this ticket.Allows the following new linters:
.golangci.yml
.Disable the following linters:
tagalign, protogetter, inamedparam, nakedret
& a subset of therevive
sub-linters. See the yaml file for more context.Clean up the golang yaml (master/.golangci.yml), updating the code & removing deprecated mentions.
Test Plan
N/A -- pass current circleCI checks.
Checklist
docs/release-notes/
.See Release Note for details.