Lines Matching defs:Style
24 << "Style #" << i << " of " << Styles.size() << " differs from Style #0"
120 Style.FIELD = false; \
121 EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": true", &Style).value()); \
122 EXPECT_TRUE(Style.FIELD); \
123 EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": false", &Style).value()); \
124 EXPECT_FALSE(Style.FIELD)
129 Style.STRUCT.FIELD = false; \
131 parseConfiguration(#STRUCT ":\n " CONFIG_NAME ": true", &Style) \
133 EXPECT_TRUE(Style.STRUCT.FIELD); \
135 parseConfiguration(#STRUCT ":\n " CONFIG_NAME ": false", &Style) \
137 EXPECT_FALSE(Style.STRUCT.FIELD)
143 EXPECT_NE(VALUE, Style.FIELD) << "Initial value already the same!"; \
144 EXPECT_EQ(0, parseConfiguration(TEXT, &Style).value()); \
145 EXPECT_EQ(VALUE, Style.FIELD) << "Unexpected value after parsing!"
155 EXPECT_NE(VALUE, Style.STRUCT.FIELD) << "Initial value already the same!"; \
156 EXPECT_EQ(0, parseConfiguration(#STRUCT ":\n " TEXT, &Style).value()); \
157 EXPECT_EQ(VALUE, Style.STRUCT.FIELD) << "Unexpected value after parsing!"
160 FormatStyle Style = {};
161 Style.Language = FormatStyle::LK_Cpp;
262 FormatStyle Style = {};
263 Style.Language = FormatStyle::LK_Cpp;
293 FormatStyle Style = {};
294 Style.Language = FormatStyle::LK_Cpp;
297 Style.QualifierAlignment = FormatStyle::QAS_Right;
307 Style.QualifierOrder.clear();
310 Style.QualifierOrder.clear();
313 Style.QualifierOrder.clear();
319 Style.FIELD.Enabled = true; \
377 Style.PointerAlignment = FormatStyle::PAS_Middle;
384 Style.ReferenceAlignment = FormatStyle::RAS_Middle;
401 Style.ReflowComments = FormatStyle::RCS_Always;
411 Style.Standard = FormatStyle::LS_Auto;
425 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
438 Style.BreakBinaryOperations = FormatStyle::BBO_Never;
446 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
457 Style.BreakInheritanceList = FormatStyle::BILS_BeforeColon;
470 Style.BinPackParameters = FormatStyle::BPPS_OnePerLine;
483 Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack;
499 Style.PackConstructorInitializers = FormatStyle::PCIS_NextLine;
506 Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack;
511 Style.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_LogicalBlock;
521 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
536 Style.AlignEscapedNewlines = FormatStyle::ENAS_Left;
551 Style.AlignOperands = FormatStyle::OAS_Align;
587 Style.UseTab = FormatStyle::UT_ForIndentation;
599 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty;
612 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
627 Style.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
642 Style.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Both;
652 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
676 Style.SpacesInParens = FormatStyle::SIPO_Never;
677 Style.SpacesInParensOptions = {};
680 Style.SpacesInParens = FormatStyle::SIPO_Never;
681 Style.SpacesInParensOptions = {};
685 Style.SpacesInParens = FormatStyle::SIPO_Never;
686 Style.SpacesInParensOptions = {};
690 Style.SpacesInParens = FormatStyle::SIPO_Never;
691 Style.SpacesInParensOptions = {};
695 Style.SpacesInParens = FormatStyle::SIPO_Never;
696 Style.SpacesInParensOptions = {};
700 Style.SpacesInParens = FormatStyle::SIPO_Never;
701 Style.SpacesInParensOptions = {};
703 Style.ColumnLimit = 123;
708 Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
727 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
746 Style.BreakAfterReturnType = FormatStyle::RTBS_All;
777 Style.BreakTemplateDeclarations = FormatStyle::BTDS_Yes;
804 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
813 Style.NamespaceIndentation = FormatStyle::NI_All;
821 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_OnlyFirstIf;
842 Style.IndentExternBlock = FormatStyle::IEBS_NoIndent;
854 Style.BitFieldColonSpacing = FormatStyle::BFCS_None;
864 Style.SortJavaStaticImport = FormatStyle::SJSIO_Before;
870 Style.SortUsingDeclarations = FormatStyle::SUD_LexicographicNumeric;
892 Style.ForEachMacros.clear();
902 Style.IfMacros.clear();
907 Style.AttributeMacros.clear();
913 Style.StatementAttributeLikeMacros.clear();
918 Style.StatementMacros.clear();
934 Style.WhitespaceSensitiveMacros.clear();
940 Style.WhitespaceSensitiveMacros.clear();
947 Style.IncludeStyle.IncludeCategories.clear();
962 Style.SortIncludes = FormatStyle::SI_Never;
972 Style.RawStringFormats.clear();
1012 EXPECT_EQ(Style.SpacesInLineCommentPrefix.Maximum, 0u);
1013 Style.SpacesInLineCommentPrefix.Minimum = 1;
1026 EXPECT_EQ(Style.SpacesInLineCommentPrefix.Minimum, 1u);
1028 Style.SpacesInAngles = FormatStyle::SIAS_Always;
1072 Style.LineEnding = DefaultLineEnding;
1076 Style.LineEnding = DefaultLineEnding;
1094 Style.SeparateDefinitionBlocks = FormatStyle::SDS_Never;
1104 FormatStyle Style = {};
1105 Style.Language = FormatStyle::LK_Cpp;
1111 &Style),
1119 EXPECT_EQ(12u, Style.IndentWidth);
1121 EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language);
1123 Style.Language = FormatStyle::LK_JavaScript;
1130 &Style),
1132 EXPECT_EQ(23u, Style.IndentWidth);
1134 EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language);
1149 Style.Language = FormatStyle::LK_Cpp;
1166 Style.ColumnLimit = 123;
1167 Style.IndentWidth = 234;
1168 Style.BreakBeforeBraces = FormatStyle::BS_Linux;
1169 Style.TabWidth = 345;
1182 &Style));
1183 EXPECT_EQ(123u, Style.ColumnLimit);
1184 EXPECT_EQ(456u, Style.IndentWidth);
1185 EXPECT_EQ(FormatStyle::BS_Stroustrup, Style.BreakBeforeBraces);
1186 EXPECT_EQ(789u, Style.TabWidth);
1194 &Style),
1203 &Style),
1206 EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language);
1208 Style.Language = FormatStyle::LK_Verilog;
1227 FormatStyle Style = {};
1228 Style.Language = FormatStyle::LK_JavaScript;
1229 Style.BreakBeforeTernaryOperators = true;
1230 EXPECT_EQ(0, parseConfiguration("BasedOnStyle: Google", &Style).value());
1231 EXPECT_FALSE(Style.BreakBeforeTernaryOperators);
1233 Style.BreakBeforeTernaryOperators = true;
1240 &Style)
1242 EXPECT_FALSE(Style.BreakBeforeTernaryOperators);
1243 EXPECT_EQ(76u, Style.IndentWidth);
1244 EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language);
1248 FormatStyle Style = getLLVMStyle();
1249 std::string YAML = configurationAsText(Style);
1253 EXPECT_EQ(Style, ParsedStyle);
1358 auto Style = getNoStyle();
1359 Style.ColumnLimit = 20;
1360 return Style;
1379 auto Style = getNoStyle();
1380 Style.ColumnLimit = 20;
1381 Style.WhitespaceSensitiveMacros = NonDefaultWhiteSpaceMacros;
1382 return Style;
1389 auto Style = getLLVMStyle();
1390 Style.ColumnLimit = 20;
1391 return Style;
1402 auto Style = getGoogleStyle();
1403 Style.ColumnLimit = 20;
1404 Style.UseTab = FormatStyle::UT_Always;
1405 return Style;
1410 auto Style = getGoogleStyle();
1411 Style.ColumnLimit = 20;
1412 Style.UseTab = FormatStyle::UT_Always;
1413 Style.WhitespaceSensitiveMacros = NonDefaultWhiteSpaceMacros;
1414 return Style;
1452 auto Style = getLLVMStyle();
1453 Style.ColumnLimit = 123;
1454 return Style;
1460 auto Style = getLLVMStyle();
1461 Style.ColumnLimit = 123;
1462 Style.IndentWidth = 7;
1463 return Style;
1484 auto Style = getStyle("file:/e/explicit.clang-format",
1486 ASSERT_TRUE(static_cast<bool>(Style));
1487 ASSERT_EQ(*Style, getGoogleStyle());
1493 Style = getStyle("file:../../e/explicit.clang-format",
1495 ASSERT_TRUE(static_cast<bool>(Style));
1496 ASSERT_EQ(*Style, getGoogleStyle());
1499 Style = getStyle("file:/e/missing.clang-format", "/e/sub/sub/sub/test.cpp",
1501 ASSERT_FALSE(static_cast<bool>(Style));
1502 llvm::consumeError(Style.takeError());
1523 Style = getStyle(format_file_arg, TestFilePath, "LLVM", "", nullptr);
1527 ASSERT_TRUE(static_cast<bool>(Style));
1528 ASSERT_EQ(*Style, getGoogleStyle());
1536 auto Style = getStyle("{invalid_key=invalid_value}", "a.h", "LLVM", "", &FS,
1539 ASSERT_TRUE((bool)Style);
1544 Style = getStyle("{invalid_key=invalid_value}", "a.h", "LLVM", "", &FS,
1547 ASSERT_TRUE((bool)Style);