'modernize-user-default-member-init' does not automatically ask to remove comma and colon when replacements are produced.
It seems, when they are apply directly from clang-tidy, the RefactoringTool engine is smart enough to remove trailing tokens.
However, when fixes are exported, clang-apply-replacements cannot do the same trick and will lead trailing commas and colon as reported on https://bugs.llvm.org/show_bug.cgi?id=35051.
This patch made “modernize-use-default-member-init” generate explicitly the removal of these locations to made it work correctly in both case (-fix and -export-fixes).
I wonder whether it's better to use lit for the tests that require formatting than to expand clang-tidy unit test utilities with runCheckAndFormatOnCode? What was the reason to use unit tests in this patch as opposed to lit tests?