mirror-llvm-project/clang-tools-extra/test/clang-tidy/checkers/custom/Inputs/clang-tidy.yml
Congcong Cai 584af2f89e
reapply "[clang-tidy] support query based custom check" (#159547)
reapply #131804 and #159289
Fixed cmake link issue.

---------

Co-authored-by: DeNiCoN <denicon1234@gmail.com>
Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
2025-09-19 21:47:57 +08:00

22 lines
576 B
YAML

CustomChecks:
- Name: test-diag-level
Query: |
match varDecl(
hasType(asString("long")),
hasTypeLoc(typeLoc().bind("long"))
).bind("decl")
Diagnostic:
- BindName: long
Message: use 'int' instead of 'long'
Level: Warning
- BindName: decl
Message: declaration of 'long'
Level: Note
- Name: test-let-bind
Query: |
let expr varDecl(isStaticStorageClass()).bind("vd")
match expr
Diagnostic:
- BindName: vd
Message: find static variable
Level: Warning