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

Closed
ti-srebot wants to merge 0 commit into
pingcap:release-5.0from
ti-srebot:release-5.0-4c77b100913e
Closed

lightning: Fix lints for lightning (#766)#989
ti-srebot wants to merge 0 commit into
pingcap:release-5.0from
ti-srebot:release-5.0-4c77b100913e

Conversation

@ti-srebot
Copy link
Copy Markdown
Contributor

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

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

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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
Copy link
Copy Markdown
Member

@ti-srebot: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@YuJuncen YuJuncen closed this Apr 12, 2021
@YuJuncen YuJuncen force-pushed the release-5.0-4c77b100913e branch from adc7582 to 21cd427 Compare April 12, 2021 07:49
@YuJuncen
Copy link
Copy Markdown
Collaborator

/cherry-pick-invite

@ti-srebot
Copy link
Copy Markdown
Contributor Author

@YuJuncen please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/br/invitations

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.

4 participants