Skip to content

add_new_check.py generates code and test that does not pass by default #50400

@llvmbot

Description

@llvmbot
Bugzilla Link 51056
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

  1. python $(llvm-project)\clang-tools-extra\clang-tidy\add_new_check.py modernize use-ranges
  2. Build the solution
  3. python $(llvm-build)$(Configuration)\bin\llvm-lit.py $(llvm-project)\clang-tools-extra\test\clang-tidy\checkers\modernize-use-ranges.cpp

Result: Generated test for new generated check has failed.
Expected - Default generated test for new default generated checks should pass!

Reason:

  • check_clang_tidy.py run clang-format with -fix option.
  • add_new_check.py generates fix-hint for DiagnosticIDs::Note (See commit f2879d8).
  • clang-tidy fixes notes with -fix-notes options only, and -fix option ignore notes...

Possible fix:

  • update add_new_check.py to generate Warning
  diag(MatchedDecl->getLocation(), "insert 'awesome'", DiagnosticIDs::Warning)
      << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");

as it was before commit f2879d8

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions