LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 51056 - add_new_check.py generates code and test that does not pass by default
Summary: add_new_check.py generates code and test that does not pass by default
Status: NEW
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: PC All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-11 16:31 PDT by Vladyslav Bondur
Modified: 2021-07-11 16:31 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladyslav Bondur 2021-07-11 16:31:09 PDT
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 f2879d8a).
 - 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 f2879d8a