[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Refactor Check to have more explicit cli args. (PR #75867)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 18 14:54:09 PST 2023


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 8be985072459ebc888fa4ec26651b9bac356be7a 75c8037b6b7788d1a0f57eed6a712204555a43d1 -- clang-tools-extra/clangd/tool/Check.h clang-tools-extra/clangd/tool/Check.cpp clang-tools-extra/clangd/tool/ClangdMain.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clangd/tool/Check.cpp b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e..5e9d8d5362 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ public:
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+          const ClangdCheckOptions &CheckOpts)
       : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
     }
 
   public:
-    OverrideConfigProvider(bool CheckTidyTime)
-        : CheckTidyTime(CheckTidyTime) {}
+    OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) {}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2db..3b08e02323 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt<bool> CheckCompletion{
     llvm::cl::desc("Run code-completion at each point (slow)"),
     llvm::cl::init(false)};
 llvm::cl::opt<bool> CheckWarnings{
-    "check-warnings",
-    llvm::cl::desc("Print warnings as well as errors"),
+    "check-warnings", llvm::cl::desc("Print warnings as well as errors"),
     llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
 
     ClangdCheckOptions CheckOpts;
     if (CheckTidyTime.getNumOccurrences())
-        CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+      CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
     CheckOpts.CheckFileLines = CheckFileLines;
     CheckOpts.CheckCompletion = CheckCompletion;

``````````

</details>


https://github.com/llvm/llvm-project/pull/75867


More information about the llvm-branch-commits mailing list