[PATCH] D90552: [clangd] Set the User option for clang-tidy to mimick its behaviour

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 11:58:42 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG062b5c598f21: [clangd] Set the User option for clang-tidy to mimick its behaviour (authored by njames93).

Changed prior to commit:
  https://reviews.llvm.org/D90552?vs=302871&id=303519#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90552/new/

https://reviews.llvm.org/D90552

Files:
  clang-tools-extra/clangd/tool/ClangdMain.cpp


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===================================================================
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -809,6 +809,11 @@
   if (EnableClangTidy) {
     auto EmptyDefaults = tidy::ClangTidyOptions::getDefaults();
     EmptyDefaults.Checks.reset(); // So we can tell if checks were ever set.
+    EmptyDefaults.User = llvm::sys::Process::GetEnv("USER");
+#ifdef _WIN32
+    if (!EmptyDefaults.User)
+      EmptyDefaults.User = llvm::sys::Process::GetEnv("USERNAME");
+#endif
     tidy::ClangTidyOptions OverrideClangTidyOptions;
     if (!ClangTidyChecks.empty())
       OverrideClangTidyOptions.Checks = ClangTidyChecks;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90552.303519.patch
Type: text/x-patch
Size: 738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201106/25344901/attachment.bin>


More information about the cfe-commits mailing list