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)#988

Merged
ti-chi-bot merged 3 commits into
pingcap:release-4.0from
ti-srebot:release-4.0-4c77b100913e
May 7, 2021
Merged

lightning: Fix lints for lightning (#766)#988
ti-chi-bot merged 3 commits into
pingcap:release-4.0from
ti-srebot:release-4.0-4c77b100913e

Conversation

@ti-srebot
Copy link
Copy Markdown
Contributor

@ti-srebot ti-srebot commented Apr 7, 2021

cherry-pick #766 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In br repo:
git pr https://github.com/pingcap/br/pull/988

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/br.git pr/988:release-4.0-4c77b100913e

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

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@YuJuncen
Copy link
Copy Markdown
Collaborator

Require #957

@YuJuncen
Copy link
Copy Markdown
Collaborator

/hold

@glorv glorv force-pushed the release-4.0-4c77b100913e branch from 87687d3 to a0a4498 Compare May 7, 2021 08:14
@glorv
Copy link
Copy Markdown
Collaborator

glorv commented May 7, 2021

/run-all-tests

1 similar comment
@glorv
Copy link
Copy Markdown
Collaborator

glorv commented May 7, 2021

/run-all-tests

@3pointer
Copy link
Copy Markdown
Collaborator

3pointer commented May 7, 2021

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 LGTM1 label May 7, 2021
@lance6716
Copy link
Copy Markdown
Contributor

/lgtm

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • lance6716

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 May 7, 2021
@glorv
Copy link
Copy Markdown
Collaborator

glorv commented May 7, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

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

DetailsCommit hash: a0a4498

@glorv
Copy link
Copy Markdown
Collaborator

glorv commented May 7, 2021

/unhold

@ti-chi-bot ti-chi-bot merged commit b76e2e0 into pingcap:release-4.0 May 7, 2021
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.

7 participants