forked from OSchip/llvm-project
[clangd] Set the User option for clang-tidy to mimick its behaviour
Probably not essential as afaik only one check uses this field. but still good to have consistent behaviour. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D90552
This commit is contained in:
parent
18805ea951
commit
062b5c598f
|
@ -809,6 +809,11 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue