[clang] [clang-format] Add -r option for recursing into directories (PR #160299)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 23 06:47:53 PDT 2025
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/tools/clang-format/ClangFormat.cpp
``````````
: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 8267417e3..bef5924ca 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -131,9 +131,10 @@ static cl::opt<std::string> Files(
cl::desc("A file containing a list of files to process, one per line."),
cl::value_desc("filename"), cl::init(""), cl::cat(ClangFormatCategory));
-static cl::opt<bool> Recursive("r",
- cl::desc("Recursively format files in any specified directories"),
- cl::cat(ClangFormatCategory));
+static cl::opt<bool>
+ Recursive("r",
+ cl::desc("Recursively format files in any specified directories"),
+ cl::cat(ClangFormatCategory));
static cl::opt<bool>
Verbose("verbose", cl::desc("If set, shows the list of processed files"),
``````````
</details>
https://github.com/llvm/llvm-project/pull/160299
More information about the cfe-commits
mailing list