================ @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; ---------------- 5chmidti wrote:
I think it would be better to exit clang-tidy at this point, when there are no checks present and `AllowNoChecks` is enabled. The current behavior of this PR for invoking `clang-tidy` to check a file would be: - if no checks are enabled and `AllowNoChecks` is true - continue executing clang-tidy even though no checks are enabled I think it should be: - if no checks are enabled - if `AllowNoChecks` is true then `return 0`, else error out with `return 1` https://github.com/llvm/llvm-project/pull/96122 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits