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

Merged
ti-chi-bot merged 1 commit into
pingcap:release-5.0from
ti-srebot:release-5.0-4c77b100913e
Apr 13, 2021
Merged

lightning: Fix lints for lightning (#766)#998
ti-chi-bot merged 1 commit into
pingcap:release-5.0from
ti-srebot:release-5.0-4c77b100913e

Conversation

@YuJuncen
Copy link
Copy Markdown
Collaborator

Well, seems there are some problems and #989 cannot be reopened. So I made a new one.


cherry-pick #766 to release-5.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/989

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

git push git@github.com:ti-srebot/br.git pr/989:release-5.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

@overvenus
Copy link
Copy Markdown
Member

/lgtm

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.

/lgtm

@glorv
Copy link
Copy Markdown
Collaborator

glorv commented Apr 13, 2021

/lgtm

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

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

glorv commented Apr 13, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

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

DetailsCommit hash: ba38164

@ti-chi-bot ti-chi-bot merged commit 4d980bc into pingcap:release-5.0 Apr 13, 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.

5 participants