Hiralo added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:329-330 + + if (!ConfigFile.empty()) { + if (!Config.empty()) { + llvm::errs() << "Error: --config-file and --config are " ---------------- Hiralo wrote: > Hiralo wrote: > > njames93 wrote: > > > nit: Should we be using `Config(File)?.getNumOccurances() > 0` here and > > > below > > > If someone puts `--config=""` They are specifying a config(file)?, even > > > if its empty. > > > nit: Should we be using `Config(File)?.getNumOccurances() > 0` here and > > > below > > > If someone puts `--config=""` They are specifying a config(file)?, even > > > if its empty. > > > > Sounds good. > > > > What is expected o/p with -config="" ? > > > > Currently it works as below... > > $ ./myinstall/bin/clang-tidy -config="" --dump-config -- > > config_occurances =1 > > config_is_empty = yes > > > > > > ``` > > Checks: 'clang-diagnostic-*,clang-analyzer-*' > > > > WarningsAsErrors: '' > > HeaderFilterRegex: '' > > AnalyzeTemporaryDtors: false > > FormatStyle: none > > CheckOptions: > > - key: llvm-else-after-return.WarnOnConditionVariables > > ... > > ``` > > nit: Should we be using `Config(File)?.getNumOccurances() > 0` here and > > below > > If someone puts `--config=""` They are specifying a config(file)?, even if > > its empty. > > Updated patch... > > $ ./myinstall/bin/clang-tidy --config="" --config-file="" --dump-config -- > Error: --config-file and --config are mutually exclusive. Specify only one. > > Thanks, > > nit: Should we be using `Config(File)?.getNumOccurances() > 0` here and > > below > > If someone puts `--config=""` They are specifying a config(file)?, even if > > its empty. > > Updated patch... > > $ ./myinstall/bin/clang-tidy --config="" --config-file="" --dump-config -- > Error: --config-file and --config are mutually exclusive. Specify only one. > > Thanks, and $ ./myinstall/bin/clang-tidy --config-file="" --dump-config -- Error: can't read config-file '': No such file or directory Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89936/new/ https://reviews.llvm.org/D89936 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits