github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp --
clang/test/Format/clang-format-ignore.cpp
clang/tools/clang-format/ClangFormat.cpp --diff_from_common_commit
``````````
:warning:
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.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/tools/clang-format/ClangFormat.cpp
b/clang/tools/clang-format/ClangFormat.cpp
index 99d35f134..01d1730af 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -401,12 +401,12 @@ class ClangFormatDiagConsumer : public DiagnosticConsumer
{
};
// Returns true on error.
-static bool format(StringRef FileName, bool ErrorOnIncompleteFormat, bool
IsIgnored) {
+static bool format(StringRef FileName, bool ErrorOnIncompleteFormat,
+ bool IsIgnored) {
const bool IsSTDIN = FileName == "-";
// We don't need to do anything, there are no changes to make.
- if (IsIgnored && (Inplace || OutputXML)) {
+ if (IsIgnored && (Inplace || OutputXML))
return false;
- }
if (!OutputXML && Inplace && IsSTDIN) {
errs() << "error: cannot use -i when reading from stdin.\n";
return true;
@@ -711,7 +711,8 @@ int main(int argc, const char **argv) {
}
if (FileNames.empty()) {
- return clang::format::format("-", FailOnIncompleteFormat,
isIgnored(AssumeFileName));
+ return clang::format::format("-", FailOnIncompleteFormat,
+ isIgnored(AssumeFileName));
}
if (FileNames.size() > 1 &&
``````````
</details>
https://github.com/llvm/llvm-project/pull/170416
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits