================
@@ -506,8 +512,11 @@ static bool format(StringRef FileName, bool 
ErrorOnIncompleteFormat = false) {
   // Get new affected ranges after sorting `#includes`.
   Ranges = tooling::calculateRangesAfterReplacements(Replaces, Ranges);
   FormattingAttemptStatus Status;
-  Replacements FormatChanges =
-      reformat(*FormatStyle, *ChangedCode, Ranges, AssumedFileName, &Status);
+  Replacements FormatChanges;
+  if (DisableFormat.getNumOccurrences() == 0 || !DisableFormat) {
+    FormatChanges =
+        reformat(*FormatStyle, *ChangedCode, Ranges, AssumedFileName, &Status);
+  }
   Replaces = Replaces.merge(FormatChanges);
----------------
HazardyKnusperkeks wrote:

```suggestion
    Replaces = Replaces.merge(FormatChanges);
  }
```

https://github.com/llvm/llvm-project/pull/137617
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to