llvm-project/clang/tools/clang-format
Andrew Smith 63a565768e [clang-format] Remove spurious JSON binding when DisableFormat = true
Relevant issue: https://github.com/llvm/llvm-project/issues/52705

When the `DisableFormat` option of `clang-format` is set to `true` and a JSON file is formatted, the ephemeral variable binding that is added to the top-level object is not removed from the formatted file.  For example, this JSON:
```
{
  "key": "value"
}
```
Is reformatted to:
```
x = {
  "key": "value"
}
```
Which is not valid JSON syntax.  This fix avoids the addition of this binding when `DisableFormat` is set to `true`, ensuring that it cannot be left behind when formatting is disabled.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D115769

Fixes #52705
2021-12-15 23:09:28 +00:00
..
fuzzer
CMakeLists.txt Revert "clang-format: Add a consumer to diagnostics engine" 2020-10-29 10:29:53 -04:00
ClangFormat.cpp [clang-format] Remove spurious JSON binding when DisableFormat = true 2021-12-15 23:09:28 +00:00
clang-format-bbedit.applescript
clang-format-diff.py [clang-format] add support for cppm files 2021-12-14 14:55:38 +00:00
clang-format-sublime.py [ClangFormat] Editor integrations inherit default style from clang-format binary 2019-05-17 07:22:55 +00:00
clang-format-test.el [Format] Fix clang-format.el unit tests after commit f349cc37cc 2019-11-11 17:55:38 +01:00
clang-format.el clang-format: Add a fallback style to Emacs mode 2019-11-06 09:50:54 +00:00
clang-format.py [Format] Work around current vim bugs in clang-format.py 2020-04-15 20:11:14 +02:00
git-clang-format [clang-format] add support for cppm files 2021-12-14 14:55:38 +00:00