-
Notifications
You must be signed in to change notification settings - Fork 11
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 rules #252
Conversation
f20c9e2
to
f1aba06
Compare
I was unable to configure |
f1aba06
to
fdcaad2
Compare
Does this make #246 obsolete? I had a feeling something like this was coming so I didn't merge |
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.
@@ -39,7 +39,7 @@ func (a *atomicBroker) DialWithOptions(id uint32, opts ...grpc.DialOption) (conn | |||
return a.load().DialWithOptions(id, opts...) | |||
} | |||
|
|||
func (a *atomicBroker) NextId() uint32 { | |||
func (a *atomicBroker) NextId() uint32 { //nolint:revive |
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.
what does this do?
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.
Ignores the naming failure on Id
instead of ID
, since we are implementing an interface from another package.
} | ||
s.log.Errorw("failed to fetch from source", "error", err) |
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.
This feels odd to me - the previous formatting was easier to read
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.
The idea is to reduce unnecessary indentation.
https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else
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.
https://go.dev/doc/effective_go#control-structures
In the Go libraries, you'll find that when an if statement doesn't flow into the next statement—that is, the body ends in break, continue, goto, or return—the unnecessary else is omitted.
No, this doesn't affect CI other than the version bump. |
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.
Does this make #246 obsolete? I had a feeling something like this was coming so I didn't merge
If it does, I think this PR is a good opportunity to update the sonar properties:
sonar.projectName=chainlink-common
This PR enables some new linters and revive rules for things we are already trying to do.