njames93 added a comment.

In D146875#4229544 <https://reviews.llvm.org/D146875#4229544>, @carlosgalvezp 
wrote:

> I think easiest is to go for Option A) - this is how we normally write checks 
> nowadays. Maybe the discussion about removing support for `--fix-notes` can 
> be done in an RFC?

Fix notes was added to address the situation that clang-tidy just blindly 
applies the first fix found with a warning, The behaviour contradicts with how 
clang handles fixes.
The basic idea is if a fix is attached to a warning, we have very high 
confidence that it is the correct fix and wont contradict the programmers 
initial intent.
Fixes attached to notes are for cases when there a multiple possible ways to 
silence a warning, or if the way to silence a warning could change the 
programmers initial intent.

Fix notes basically reverts clang tidy to use the old behaviour of just blindly 
applying the first fix it finds, which some users may wish to use, there fore 
shouldn't be removed.

The simplest thing here is to just update the example generator script to 
attach the fix directly to the warning.
In fact, I'd go as far as saying including adding `--fix-notes` to the test 
file can harm new checks in future as fixes may not be applied when running 
normally


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146875/new/

https://reviews.llvm.org/D146875

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to