Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable clang-tidy bugprone-redundant-branch-condition #58898

Conversation

jbytheway
Copy link
Contributor

@jbytheway jbytheway commented Jul 2, 2022

Summary

None

Purpose of change

More static analysis.

The bugprone-redundant-branch-condition check looks for conditions in if statements that are already guaranteed to be true due to earlier conditions.

Describe the solution

Apply the automated fixes.

Describe alternatives you've considered

None.

Testing

I verified by eye that the conditions did indeed seem to be redundant.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jul 2, 2022
@NetSysFire NetSysFire added the Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style label Jul 2, 2022
@NetSysFire
Copy link
Member

Sort-of unrelated but PRs touching .clang-tidy should get the Infrastructure label applied.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 2, 2022
@jbytheway
Copy link
Contributor Author

jbytheway commented Jul 2, 2022

clang-tidy errors found in CI here are fixed in #58908. That is now merged.

@jbytheway jbytheway force-pushed the clang-tidy_bugprone-redundant-branch-condition branch from bd3fd32 to 23134f2 Compare July 2, 2022 23:49
This check looks for conditions in if statements that are already
guaranteed to be true due to earlier conditions.
@jbytheway jbytheway force-pushed the clang-tidy_bugprone-redundant-branch-condition branch from 23134f2 to efd362b Compare July 4, 2022 20:04
@ZhilkinSerg ZhilkinSerg merged commit effb12e into CleverRaven:master Jul 4, 2022
@jbytheway jbytheway deleted the clang-tidy_bugprone-redundant-branch-condition branch July 5, 2022 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants