[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-03-17 Thread Ibraim Ganiev via cfe-commits
olologin wrote: Just FYI: I have tested @DeNiCoN on our codebase in the company we work with him together (~8k Translation units), and it seems to work fine. `NOLINT(check-name)` works, .clang-tidy config inheritance works (In case some subfolders want to disable particular matchers). Very use

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-03-09 Thread via cfe-commits
DeNiCoN wrote: > Hello @DeNiCoN, Are you still working on this patch? If not, I hope I can > take over this patch to finally finish it. Hello @HerrCai0907. I'm not actively working on it. You can take over Some notes: I've found a bug that if a config file is not explicitly specified(no `--co

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-03-08 Thread Congcong Cai via cfe-commits
HerrCai0907 wrote: Hello @DeNiCoN, Are you still working on this patch? If not, I hope I can take over this patch to finally finish it. https://github.com/llvm/llvm-project/pull/123734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-22 Thread via cfe-commits
https://github.com/DeNiCoN edited https://github.com/llvm/llvm-project/pull/123734 ___ 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 ClangQueryChecks config option (PR #123734)

2025-01-22 Thread via cfe-commits
@@ -126,8 +127,15 @@ struct ClangTidyOptions { using StringPair = std::pair; using OptionMap = llvm::StringMap; + struct QueryCheckValue { +std::string Source; DeNiCoN wrote: It is used to dump the config back. As for example in the "Check config dum

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Additionally, consider implementing this as an "module" (like bugprone), simply implement factory that would look into config options that start with "custom-" and then parse options like: Source, Message, Language, and based on that construct checks, gain is that dependency on

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/123734 ___ 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 ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -292,6 +292,18 @@ An overview of all the command-line options: Checks - Same as '--checks'. Additionally, the list of globs can be specified as a list instead of a string. +

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Additionally: - more detailed documentation needed (entire section in documentation) - i would name it CustomChecks instead - need protection against check name conflicts, and maybe some protection for adding checks for current

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -38,6 +39,7 @@ clang_target_link_libraries(clangTidy clangSerialization clangTooling clangToolingCore + clangQuery PiotrZSL wrote: this introduces new dependency, how it will impact for example clangd ? will those checks work there ? https://github.

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,53 @@ +// DEFINE: %{custom-call-yaml} = custom-call: 'm callExpr().bind(\"Custom message\")' +// +// DEFINE: %{custom-let-call-yaml} = custom-let-call: \" \ +// DEFINE: let expr varDecl( \ +// DEFINE: hasType(asString(\

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -292,6 +292,18 @@ An overview of all the command-line options: Checks - Same as '--checks'. Additionally, the list of globs can be specified as a list instead of a string. +

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,43 @@ +//===--- ClangQueryCheck.h - clang-tidy *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Piotr Zegar via cfe-commits
@@ -140,6 +140,9 @@ Improvements to clang-tidy :doc:`readability-redundant-access-specifiers `, CheckFirstDeclaration :doc:`readability-redundant-casting `, IgnoreTypeAliases +- New :program:`clang-tidy` config property `ClangQueryChecks` that allows adding ---

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread via cfe-commits
DeNiCoN wrote: > Could it be a normal check under misc and pass the query in config instead of > create a new pattern? It could be. But this will only be a single check. Having the ability to define multiple checks allows to have more fine control over them using NOLINT. If multiple checks is

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 commented: Could it be a normal check under misc and pass the query in config instead of create a new pattern? https://github.com/llvm/llvm-project/pull/123734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: None (DeNiCoN) Changes This addresses the #107680. This pull request adds new config option that allows to define new checks using the [matchers](https://clang.llvm.org/docs/LibASTMatchersReference.html) syntax by incorporating cla

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: None (DeNiCoN) Changes This addresses the #107680. This pull request adds new config option that allows to define new checks using the [matchers](https://clang.llvm.org/docs/LibASTMatchersReference.html) syntax by incorporat

[clang-tools-extra] [clang-tidy] Add ClangQueryChecks config option (PR #123734)

2025-01-21 Thread via cfe-commits
DeNiCoN wrote: @AaronBallman could you be a reviewer please? https://github.com/llvm/llvm-project/pull/123734 ___ 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 ClangQueryChecks config option (PR #123734)

2025-01-21 Thread via cfe-commits
https://github.com/DeNiCoN created https://github.com/llvm/llvm-project/pull/123734 This addresses the #107680. This pull request adds new config option that allows to define new checks using the [matchers](https://clang.llvm.org/docs/LibASTMatchersReference.html) syntax by incorporating cla