Is there a way to modify multiple locations if a given check finds an issue? My use case is I am checking for class naming conventions.
If the check finds a declaration I can figure out how to modify the name at the declaration, but I want to also change all usages at the same time.
It's possible to supply several FixItHints, and they can be in any source
files known to SourceManager. I didn't check, but this should work, and if
it doesn't, I'll fix it.
But you're going to face another problem as well: usages of a class or its
members may be spread over many translation units, and clang-tidy's support
of the multiple-TU use-case is rudimentary at the moment. While you can run
the clang-tidy binary on several translation units, and it will even
deduplicate error reports by code location, there are still many things to
do in this land:
* We'll need a way to run over all translation units in the compilations
database, so that clang-tidy can be sure it sees all the code, and that the
changes it makes are complete.
* We'll need a way to separate analysis from the actual application of
generated fixes, so that one could run several clang-tidy processes in
parallel to speed up the refactoring.
* We'd also need not only to deduplicate changes, but also check all the
changes for mutual compatibility - this is not specific to multi-TU
use-case, but with multiple TUs chances to get incompatible changes are
I'm probably missing something else that would be important for the