How to use clang-apply-replacements with clang-tidy fixit file

I used clang-tidy to generate some replacements for a code base into a yaml file using the -export-fixits=file option. After editing the file to remove some unwanted changes, I would like to apply those fixes. The documentation says to use clang-apply-replacements, but I don’t see how do use it to do that. It looks more like it’s designed to work with clang-format. Any suggestions?

Many thanks,
Robert

I used clang-tidy to generate some replacements for a code base into a yaml file using the -export-fixits=file option. After editing the file to remove some unwanted changes, I would like to apply those fixes. The documentation says to use clang-apply-replacements, but I don't see how do use it to do that. It looks more like it's designed to work with clang-format. Any suggestions?

If you don't care about formatting the post-replacement code with
clang format, just run "clang-apply-replacements /path/to/source/dir'.
It will scan for '.yml' files, and apply all replacements.

Chris

Back on the ML., let's keep the discussion public and archived.

I used the run-clang-tidy script to operate across a large compilation database using:

run-clang-tidy.py -header-filter=.* -checks=-*,-cppcoreguidelines-pro-type-member-init -export-fixes=ctinit.yaml

This generated a large YAML fixit file. I’ve since edited the file to remove and/or change some of the fixits. I’m now writing a program to split the results into a set of file by file fixits with duplicates removed so I can apply the results in stages.

Robert