clang-format adds spurious binding to JSON file with DisableFormat: true #52705
Labels
bug
Indicates an unexpected problem or unintended behavior
clang-format
good first issue
https://github.com/llvm/llvm-project/contribute
With
clang-format
built from the head ofmain
and the following.clang-format
file, which should fully disable formatting for JSON files:The following file:
Is reformatted as follows, with a spurious binding that results in invalid JSON:
With
DisableFormat: false
or no.clang-format
file at all, the binding is not added to the file.Research note: This issue is a result of the way that
clang-format
implements JSON formatting by adding a binding to the top-level object in order to forceclang::format
to treat the code as plain JavaScript. I have already tracked down the issue and am currently preparing a patch.The text was updated successfully, but these errors were encountered: