-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enable Golangci-lint #224
Merged
Merged
Enable Golangci-lint #224
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It wasn't enforced until now. I tried to disable linters I found unreasonable, but I may have left some of them. I fixed a lot of issues (many of them legitimate). But after 4 hours I got sick of it, so people will need to fix more issues as they change code (golangci, for now at least, is set to bark of code you change). I may spend another long session cleaning up stuff, but not for today.
2opremio
force-pushed
the
enable-golangci
branch
from
June 18, 2024 22:45
52e747b
to
32a113d
Compare
2opremio
force-pushed
the
enable-golangci
branch
from
June 18, 2024 23:00
47404cc
to
f6fad08
Compare
2opremio
force-pushed
the
enable-golangci
branch
2 times, most recently
from
June 18, 2024 23:33
3f3cacc
to
19b5c3e
Compare
psheth9
approved these changes
Jun 20, 2024
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.
just few comments. Lots of small non violent linter fixes, overall looks good to me.
Awesome work !!
2opremio
added a commit
to 2opremio/soroban-rpc
that referenced
this pull request
Jul 17, 2024
I broke it at stellar#228 It turns out that `github.com/stellar/go/support/errors.Wrapf` returns nil if the error is nil (which is different to how `errors.Errorf` behaves). I have looked at both stellar#228 and stellar#224 and this is the only instance in which we replaced `Wrapf` by `Errorf` where we don't first check the error for `nil`.
2opremio
added a commit
to 2opremio/soroban-rpc
that referenced
this pull request
Jul 17, 2024
I broke it at stellar#228 It turns out that `github.com/stellar/go/support/errors.Wrapf` returns nil if the error is nil (which is different to how `errors.Errorf` behaves). I have looked at both stellar#228 and stellar#224 and this is the only instance in which we replaced `Wrapf` by `Errorf` where we don't first check the error for `nil`.
2opremio
added a commit
that referenced
this pull request
Jul 17, 2024
I broke it at #228 It turns out that `github.com/stellar/go/support/errors.Wrapf` returns nil if the error is nil (which is different to how `errors.Errorf` behaves). I have looked at both #228 and #224 and this is the only instance in which we replaced `Wrapf` by `Errorf` where we don't first check the error for `nil`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Enable GolangCI-lint in Pull requests
I tried to disable linters I found unreasonable, but I may have forgotten some of them.
I fixed a lot of issues (many of them legitimate). But after 4 hours I got sick of it, so people will need to fix more issues as they change code.
GolangCI-lint, until we clean everything up, is set to bark on code you change.
I may spend another long session cleaning up stuff, but not for today.
Why
It wasn't enforced until now.
Known limitations
You will have to be patient with false positives and fixing code unrelated to your PR until it stabilizes.