[clang-apply-replacements] Change cleanup to only happen with --format (#178763)

Cleanup can result in many unrelated changes to the given replacements.
This change makes that only apply if the user actually wants
clang-apply-replacements to format their code outside of the
replacements.
This commit is contained in:
Keith Smiley 2026-02-05 18:54:44 -08:00 committed by GitHub
parent e3c72cf008
commit 0cb14760da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,7 +139,7 @@ int main(int argc, char **argv) {
return 1;
tooling::ApplyChangesSpec Spec;
Spec.Cleanup = true;
Spec.Cleanup = DoFormat;
Spec.Format = DoFormat ? tooling::ApplyChangesSpec::kAll
: tooling::ApplyChangesSpec::kNone;
Spec.Style = DoFormat ? FormatStyle : format::getNoStyle();