Skip to content

Conversation

capitan-davide
Copy link
Contributor

Closes #162140

Copy link

github-actions bot commented Oct 7, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp,h -- clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.cpp clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.h clang-tools-extra/test/clang-tidy/checkers/bugprone/inconsistent-ifelse-braces.cpp clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.cpp
index e0ca5605e..b69546797 100644
--- a/clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/InconsistentIfelseBracesCheck.cpp
@@ -51,12 +51,12 @@ void InconsistentIfelseBracesCheck::registerMatchers(MatchFinder *Finder) {
       this);
 }
 
-void InconsistentIfelseBracesCheck::check(const MatchFinder::MatchResult &Result) {
+void InconsistentIfelseBracesCheck::check(
+    const MatchFinder::MatchResult &Result) {
   const auto *MatchedIf = Result.Nodes.getNodeAs<IfStmt>("if_stmt");
 
   if (shouldHaveBraces(MatchedIf) && !doesHaveBraces(MatchedIf)) {
-    diag(MatchedIf->getBeginLoc(), "bad!")
-        << MatchedIf->getSourceRange();
+    diag(MatchedIf->getBeginLoc(), "bad!") << MatchedIf->getSourceRange();
   }
 }
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[clang-tidy] New check: bugprone-ifelse-braces
1 participant