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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 09:19:53 PST 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/tool/ClangdMain.cpp:812
+    EmptyDefaults.User = llvm::sys::Process::GetEnv("USER");
+    if (!EmptyDefaults.User)
+      EmptyDefaults.User = llvm::sys::Process::GetEnv("USEUSERNAMER");
----------------
do you think we should #ifdef this for windows?

maybe like
```
User = llvm::sys::Process::GetEnv(
#ifdef _WIN32
"USERNAME"
#else
"USER"
)
```

(or maybe always query USER but only query USERNAME on windows, or something else?)


================
Comment at: clang-tools-extra/clangd/tool/ClangdMain.cpp:813
+    if (!EmptyDefaults.User)
+      EmptyDefaults.User = llvm::sys::Process::GetEnv("USEUSERNAMER");
     tidy::ClangTidyOptions OverrideClangTidyOptions;
----------------
I think this is meant to be USERNAME?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90552



More information about the cfe-commits mailing list