Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

lightning: Fix lints for lightning#766

Merged
ti-chi-bot merged 49 commits into
pingcap:masterfrom
YuJuncen:lightning-lint
Apr 7, 2021
Merged

lightning: Fix lints for lightning#766
ti-chi-bot merged 49 commits into
pingcap:masterfrom
YuJuncen:lightning-lint

Conversation

@YuJuncen
Copy link
Copy Markdown
Collaborator

@YuJuncen YuJuncen commented Mar 1, 2021

What problem does this PR solve?

CI for tidb-lightning doesn't include lints, after merged into this repository, we hope it can pass the CI tests too.

What is changed and how it works?

Refactoring following what the linter says.

NOTEs

Those linters are disabled:

  • errorlint, because pingcap/errors is incompatible with std errors.(see below)
    Standard errors uses err.Unwrap() to get cause of errors. But pingcap/errors uses err.Cause() and errors.Unwrap(err). If we follow this linter, using errors.Is to check error class, causes of errors would be omitted.
  • wrapcheck, because there are too many unwrapped errors in tidb-lightning. An option is using a script to wrap them with errors.Trace(err), which is tricky, and in someway not really wrapped those errors. Maybe we need farther refactoring for error returning.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Release Note

  • No release note

@YuJuncen YuJuncen marked this pull request as draft March 1, 2021 10:20
@YuJuncen YuJuncen marked this pull request as ready for review March 2, 2021 07:34
@YuJuncen YuJuncen changed the title [WIP] Fix lints for lightning lightning: Fix lints for lightning Mar 2, 2021
@YuJuncen YuJuncen requested review from overvenus and removed request for lance6716 April 2, 2021 09:28
@overvenus
Copy link
Copy Markdown
Member

/lgtm

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • overvenus

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels Apr 7, 2021
Copy link
Copy Markdown
Collaborator

@glorv glorv left a comment

Choose a reason for hiding this comment

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

rest LGTM

Comment thread pkg/lightning/checkpoints/checkpoints.go Outdated
Co-authored-by: glorv <glorvs@163.com>
@YuJuncen
Copy link
Copy Markdown
Collaborator Author

YuJuncen commented Apr 7, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 9baf6ea

@ti-chi-bot ti-chi-bot merged commit 4c77b10 into pingcap:master Apr 7, 2021
ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Apr 7, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-4.0 in PR #988

ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Apr 7, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-5.0 in PR #989

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants