Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
llvmbot opened this issue Jul 11, 2021 · 1 comment
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla clang-tidy

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 11, 2021

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@PiotrZSL PiotrZSL self-assigned this Mar 26, 2023
@PiotrZSL
Copy link
Member

@PiotrZSL PiotrZSL added the awaiting-review Has pending Phabricator review label Mar 28, 2023
@github-actions github-actions bot removed the awaiting-review Has pending Phabricator review label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy
Projects
None yet
Development

No branches or pull requests

2 participants