Skip to content

Support static analysis by clang-tidy#2834

Merged
ti-chi-bot merged 6 commits intopingcap:masterfrom
solotzg:use-clang-tidy
Sep 3, 2021
Merged

Support static analysis by clang-tidy#2834
ti-chi-bot merged 6 commits intopingcap:masterfrom
solotzg:use-clang-tidy

Conversation

@solotzg
Copy link
Contributor

@solotzg solotzg commented Sep 2, 2021

What problem does this PR solve?

Problem Summary:

What is changed and how it works?

  • implement code static analysis by clang-tidy-12.

What's Changed:

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release note

Support static analysis by clang-tidy

@solotzg solotzg added type/enhancement The issue or PR belongs to an enhancement. type/code-quality-improvement PR that can improve the code quality labels Sep 2, 2021
@solotzg solotzg requested a review from fuzhe1989 September 2, 2021 07:07
@solotzg solotzg self-assigned this Sep 2, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 2, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • fuzhe1989

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 2, 2021
@JaySon-Huang
Copy link
Contributor

I think the release note should be "None" cause it is not a change for the users?

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Sep 2, 2021
@solotzg
Copy link
Contributor Author

solotzg commented Sep 2, 2021

/run-all-tests

@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Sep 2, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 2, 2021
@solotzg
Copy link
Contributor Author

solotzg commented Sep 2, 2021

I think the release note should be "None" cause it is not a change for the users?

clang-tidy check is enabled. @JaySon-Huang @fuzhe1989 PTAL

@solotzg
Copy link
Contributor Author

solotzg commented Sep 2, 2021

/run-all-tests

-DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
-DUSE_CCACHE=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
python3 ${SRCPATH}/release-centos7/build/fix_compile_commands.py --file_path=${BUILD_DIR}/compile_commands.json --includes=/tmp/usr/lib64/clang/12.0.0/include --load_diff_files_from "/tmp/tiflash-diff-files.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

So we only enable those static analyses on those files changed in PR. And if those files do not pass the check, it will make the build fail?
I guess it is not a good idea cause it will bring lots of Irrelevant changes when you change a big file.
Maybe we should clean those warnings before enabling a lint?

Ref: pingcap/tidb#22979

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should merge this PR to finish the task. Then use another PR to disable static-analysis temporarily.

@solotzg
Copy link
Contributor Author

solotzg commented Sep 3, 2021

Can we merge it first? If necessary, someone could disable static-analysis in another PR.

@solotzg
Copy link
Contributor Author

solotzg commented Sep 3, 2021

/merge

@ti-chi-bot
Copy link
Member

@solotzg: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

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

DetailsCommit hash: c719da0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 3, 2021
@ti-chi-bot ti-chi-bot merged commit b73e82a into pingcap:master Sep 3, 2021
@solotzg solotzg deleted the use-clang-tidy branch September 3, 2021 03:18
@breezewish
Copy link
Member

Is clang-tidy enabled now?

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

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/code-quality-improvement PR that can improve the code quality type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants