llvm-project/clang/lib/Format
mydeveloperday 95b3947111 [clang-format] JSON formatting add new option for controlling newlines in json arrays
Working in a mixed environment of both vscode/vim with a team configured prettier configuration, this can leave clang-format and prettier fighting each other over the formatting of arrays, both simple arrays of elements.

This review aims to add some "control knobs" to the Json formatting in clang-format to help align the two tools so they can be used interchangeably.

This will allow simply arrays `[1, 2, 3]` to remain on a single line but will break those arrays based on context within that array.

Happy to change the name of the option (this is the third name I tried)

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D133589
2022-09-19 17:54:39 +01:00
..
AffectedRangeManager.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
AffectedRangeManager.h
BreakableToken.cpp Use is_sorted (NFC) 2022-07-29 21:18:42 -07:00
BreakableToken.h [clang-format] Add option to control the spaces in a line comment 2021-02-01 22:48:50 +01:00
CMakeLists.txt [clang-format] Add MacroUnexpander. 2022-07-12 07:11:46 +00:00
ContinuationIndenter.cpp [clang-format] Handle Verilog case statements 2022-07-29 00:38:30 +00:00
ContinuationIndenter.h [clang-format][NFC] Replace most of std::vector with SmallVector 2022-07-13 16:45:22 -07:00
DefinitionBlockSeparator.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
DefinitionBlockSeparator.h [clang-format] Fix SeparateDefinitionBlocks issues 2022-01-24 14:23:20 +00:00
Encoding.h
Format.cpp [clang-format] JSON formatting add new option for controlling newlines in json arrays 2022-09-19 17:54:39 +01:00
FormatInternal.h Move clang/Tooling/Core/Lookup.h to clang/Tooling/Refactoring/Lookup.h 2020-10-20 10:13:28 +01:00
FormatToken.cpp [clang] adds unary type transformations as compiler built-ins 2022-08-22 03:03:32 +00:00
FormatToken.h [clang] adds unary type transformations as compiler built-ins 2022-08-22 03:03:32 +00:00
FormatTokenLexer.cpp [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 09:12:46 -07:00
FormatTokenLexer.h [clang-format] Handle Verilog numbers and operators 2022-07-29 00:38:29 +00:00
MacroCallReconstructor.cpp Fix build errors. 2022-07-12 07:43:26 +00:00
MacroExpander.cpp [clang-format] Elide unnecessary braces. NFC. 2022-02-02 14:36:01 +01:00
Macros.h [clang-format][NFC] Replace most of std::vector with SmallVector 2022-07-13 16:45:22 -07:00
NamespaceEndCommentsFixer.cpp [clang-format] Fix namespace format when the name is followed by a macro 2022-03-10 15:00:32 -08:00
NamespaceEndCommentsFixer.h
QualifierAlignmentFixer.cpp Remove redundant initialization of Optional (NFC) 2022-08-20 21:18:28 -07:00
QualifierAlignmentFixer.h [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null 2022-01-06 19:40:39 +00:00
SortJavaScriptImports.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
SortJavaScriptImports.h
TokenAnalyzer.cpp [clang-format] Skip token annotation in passes that don't need it 2022-09-18 11:19:40 -07:00
TokenAnalyzer.h [clang-format] Skip token annotation in passes that don't need it 2022-09-18 11:19:40 -07:00
TokenAnnotator.cpp [clang-format] JSON formatting add new option for controlling newlines in json arrays 2022-09-19 17:54:39 +01:00
TokenAnnotator.h [clang-format] Fix template arguments in macros 2022-09-16 13:30:46 +00:00
UnwrappedLineFormatter.cpp [clang-format] Fix a bug in merging blocks with a wrapped l_brace 2022-09-02 21:38:36 -07:00
UnwrappedLineFormatter.h [NFC][clang-format] Fix typo 2022-08-29 09:34:05 +08:00
UnwrappedLineParser.cpp [clang-format] Fix template arguments in macros 2022-09-16 13:30:46 +00:00
UnwrappedLineParser.h [clang-format] Fix template arguments in macros 2022-09-16 13:30:46 +00:00
UsingDeclarationsSorter.cpp [clang-format] Use ranged for loops. NFC. 2022-02-01 14:10:48 +01:00
UsingDeclarationsSorter.h
WhitespaceManager.cpp [clang-format][NFC] Format lib/Format and unittests/Format in clang 2022-06-09 02:25:06 -07:00
WhitespaceManager.h [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays 2022-03-12 17:22:31 +00:00