[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/96122 When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-tidy Author: Congcong Cai (HerrCai0907) Changes When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- Full diff: https://github.com/llvm/llvm-project/pull/96122.diff 2 Files Affected: - (modified) clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp (+10-2) - (modified) clang-tools-extra/docs/ReleaseNotes.rst (+3) ``diff diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ `` 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( SimplyDanny wrote: Should the option names be in sync? ```suggestion static cl::opt AllowEmptyCheckList("allow-empty-check-list", desc(R"( ``` or ```suggestion static cl::opt AllowEmptyChecks("allow-empty-checks", desc(R"( ``` 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/PiotrZSL edited 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` PiotrZSL wrote: you need to document this also in other places in documentation. 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` PiotrZSL wrote: maybe better --allow-no-checks or something that would suggest that clang-tidy will not fail with empty check list 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` PiotrZSL wrote: this push request does not contain new config option, only argument. 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/PiotrZSL requested changes to this pull request. if a reason for this parameter is not to fail wrapper scripts, then maybe run-clang-tidy.py / run-clang-tidy-diff.py should also be updated. 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
HerrCai0907 wrote: > if a reason for this parameter is not to fail wrapper scripts, then maybe > run-clang-tidy.py / run-clang-tidy-diff.py should also be updated. Both of them is fine because they only count the failed file and don't do any check about failure. 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/2] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/2] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/5chmidti edited 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/5chmidti commented: ´run-clang-tidy.py` and `clang-tidy-diff.py` should probably expose an option to enable this option via the script (maybe with an adjustment to the release notes). 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/3] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/3] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/4] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/4] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/5] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/5] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/SimplyDanny approved this pull request. 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/SimplyDanny edited 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-no-checks` to suppress "no checks enabled" error + when disabling all of the checks. SimplyDanny wrote: Perhaps give a hint on what "disabling all checks" means in practice: ```suggestion when disabling all of the checks by `--checks='-*'`. ``` 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/6] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/6] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
@@ -0,0 +1,5 @@ +// RUN: not clang-tidy %s -checks='-*' +// RUN: clang-tidy %s -checks='-*' --allow-no-checks | FileCheck --match-full-lines %s + + +// CHECK: No checks enabled. 5chmidti wrote: missing newline 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
5chmidti wrote: the same should probably be done for `diff-clang-tidy.py` 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
HerrCai0907 wrote: Where is `diff-clang-tidy.py`? 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
HerrCai0907 wrote: I found it. It named `clang-tidy-diff.py` 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 edited 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/96122 >From 41993ea6903668c41eef8a4477f5914c894f7109 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Wed, 19 Jun 2024 23:20:09 + Subject: [PATCH 1/8] [clang-tidy] add option to avoid "no checks enabled" error When clang-tidy get an empty checks, it will throw "no checks enabled" error and exit with non-zero return value. It make clang-tidy's wrapper program confused when in big project some files don't want to be checked and use `-checks=-*` to disable all checks. --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 12 ++-- clang-tools-extra/docs/ReleaseNotes.rst | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 7388f20ef288e..b579aff4394c9 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,6 +325,14 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); +static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +Allow empty enabled checks. This suppresses +the "no checks enabled" error when disabling +all of the checks. +)"), + cl::init(false), + cl::cat(ClangTidyCategory)); + namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { @@ -598,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty()) { +if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty()) { + if (EnabledChecks.empty() && !AllowEmptyCheckList) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3bdd735f7dcf7..54cfcafd121b6 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` + to suppress "no checks enabled" error when disabling all of the checks. + New checks ^^ >From 9302feee8fa9d19711ad2126dddbd73c044502b0 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 20 Jun 2024 17:58:10 +0800 Subject: [PATCH 2/8] fix acc comment --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 +++--- clang-tools-extra/docs/ReleaseNotes.rst | 4 ++-- clang-tools-extra/docs/clang-tidy/index.rst | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index b579aff4394c9..1475816827ac4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -325,7 +325,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -static cl::opt AllowEmptyCheckList("allow-empty-checks", desc(R"( +static cl::opt AllowNoChecks("allow-no-checks", desc(R"( Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. @@ -606,7 +606,7 @@ int clangTidyMain(int argc, const char **argv) { } if (ListChecks) { -if (EnabledChecks.empty() && !AllowEmptyCheckList) { +if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "No checks enabled.\n"; return 1; } @@ -659,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) { return 0; } - if (EnabledChecks.empty() && !AllowEmptyCheckList) { + if (EnabledChecks.empty() && !AllowNoChecks) { llvm::errs() << "Error: no checks enabled.\n"; llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Categorized=*/true); return 1; diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 54cfcafd121b6..e9a9cd47e9215 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -125,8 +125,8 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. -- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList` - to suppress "no checks enabled" error when disabling all of the checks. +- Added arg
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/5chmidti approved this pull request. LGTM 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
[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)
https://github.com/HerrCai0907 closed 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