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

Add a new lint task to replace the lint-go task and use golangci-lint #679

Merged
merged 20 commits into from
Aug 2, 2024

Conversation

autarch
Copy link
Collaborator

@autarch autarch commented Jun 14, 2024

This gets rid of the ancient fork of golint we were using and replaces it with golangci-lint, fixing quite a few linting issues found by golangci-lint.

It also removes the format-go task, as that can be done with precious and golangci-lint as well.

@autarch autarch force-pushed the modernize-linting-part-2 branch 3 times, most recently from faa8751 to 7e561c5 Compare June 14, 2024 05:07
@autarch autarch changed the title Modernize linting part 2 Add a new lint task to replace the lint-go task and use golangci-lint Jun 14, 2024
Base automatically changed from modernize-linting-part-1 to master June 20, 2024 13:53
@autarch autarch force-pushed the modernize-linting-part-2 branch 5 times, most recently from a3c4aa9 to efe13c0 Compare June 25, 2024 13:22
@autarch autarch force-pushed the modernize-linting-part-2 branch 10 times, most recently from 8f7bb69 to df326d0 Compare July 15, 2024 20:42
@autarch
Copy link
Collaborator Author

autarch commented Jul 16, 2024

Since this is a big change, I will not merge this until after our next release.

This will eventually replace the existing `lint-go` and `lint-js` tasks
common/failpoint/failpoint.go Outdated Show resolved Hide resolved
common/testutil/testutil.go Outdated Show resolved Hide resolved
common/txn/buffer.go Show resolved Hide resolved
mongorestore/oplog.go Outdated Show resolved Hide resolved
// errors are received
func channelQuorumError(ch <-chan error, quorum int) (err error) {
// errors are received.
func channelQuorumError(ch <-chan error) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this function need to change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Every single caller set quorum to 2, so I just made this a const.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the function's comment wasn't updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

mongoimport/csv.go Show resolved Hide resolved
autarch and others added 3 commits July 29, 2024 11:45
Co-authored-by: Jian Guan <61915096+tdq45gj@users.noreply.github.com>
Co-authored-by: Jian Guan <61915096+tdq45gj@users.noreply.github.com>
@autarch autarch requested a review from tdq45gj July 29, 2024 16:50
Copy link
Contributor

@tdq45gj tdq45gj left a comment

Choose a reason for hiding this comment

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

LGTM % one remaining comment.

// errors are received
func channelQuorumError(ch <-chan error, quorum int) (err error) {
// errors are received.
func channelQuorumError(ch <-chan error) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the function's comment wasn't updated.

@autarch autarch requested review from edobranov and removed request for suspicious-mango July 30, 2024 17:17
Copy link
Contributor

@edobranov edobranov left a comment

Choose a reason for hiding this comment

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

LGTM % one question

Copy link
Contributor

Choose a reason for hiding this comment

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

Might've missed it, but are we using this anywhere? (if not, do we think we'll use it?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, we will use it in a follow-up PR. Not sure how that snuck into this one, but I'll leave it since the next PR is just waiting on this one to be merged.

@autarch autarch merged commit 70f1e40 into master Aug 2, 2024
36 of 38 checks passed
@autarch autarch deleted the modernize-linting-part-2 branch August 2, 2024 14: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
3 participants