[clang-format] Cpp11BracedListStyle: true
MODIFY
.clang-format
.clang-format
@@ -23,7 +23,7 @@ BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakConstructorInitializersBeforeComma: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
-Cpp11BracedListStyle: false
+Cpp11BracedListStyle: true
IndentCaseLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: All

MODIFY
include/PostBuildLint_BuildPolicies.h
include/PostBuildLint_BuildPolicies.h
@@ -39,7 +39,6 @@ namespace vcpkg::PostBuildLint
static constexpr BuildPolicies EMPTY_INCLUDE_FOLDER(BuildPolicies::BackingEnum::EMPTY_INCLUDE_FOLDER);
static constexpr std::array<BuildPolicies, 4> VALUES = {
- EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER
- };
+ EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER};
}
}

MODIFY
include/PostBuildLint_BuildType.h
include/PostBuildLint_BuildType.h
@@ -52,7 +52,6 @@ namespace vcpkg::PostBuildLint
static constexpr BuildType RELEASE_DYNAMIC = {BE::RELEASE_DYNAMIC, CC::RELEASE, LC::DYNAMIC};
static constexpr std::array<BuildType, 4> VALUES = {
- DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC
- };
+ DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC};
}
}

MODIFY
include/vcpkg_Commands.h
include/vcpkg_Commands.h
@@ -29,8 +29,7 @@ namespace vcpkg::Commands
BuildResult::SUCCEEDED,
BuildResult::BUILD_FAILED,
BuildResult::POST_BUILD_CHECKS_FAILED,
- BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES
- };
+ BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES};
const std::string& to_string(const BuildResult build_result);
std::string create_error_message(const BuildResult build_result, const PackageSpec& spec);

MODIFY
src/commands_available_commands.cpp
src/commands_available_commands.cpp
@@ -7,9 +7,12 @@ namespace vcpkg::Commands
const std::vector<PackageNameAndFunction<CommandTypeA>>& get_available_commands_type_a()
{
static std::vector<PackageNameAndFunction<CommandTypeA>> t = {
- { "install", &Install::perform_and_exit }, { "ci", &CI::perform_and_exit },
- { "remove", &Remove::perform_and_exit }, { "build", &Build::perform_and_exit },
- { "env", &Env::perform_and_exit }, { "build-external", &BuildExternal::perform_and_exit },
+ {"install", &Install::perform_and_exit},
+ {"ci", &CI::perform_and_exit},
+ {"remove", &Remove::perform_and_exit},
+ {"build", &Build::perform_and_exit},
+ {"env", &Env::perform_and_exit},
+ {"build-external", &BuildExternal::perform_and_exit},
{"export", &Export::perform_and_exit},
};
return t;

MODIFY
src/commands_install.cpp
src/commands_install.cpp
@@ -174,9 +174,8 @@ namespace vcpkg::Commands::Install
static void print_plan(const std::map<InstallPlanType, std::vector<const InstallPlanAction*>>& group_by_plan_type)
{
- static constexpr std::array<InstallPlanType, 3> order = { InstallPlanType::ALREADY_INSTALLED,
- InstallPlanType::BUILD_AND_INSTALL,
- InstallPlanType::INSTALL };
+ static constexpr std::array<InstallPlanType, 3> order = {
+ InstallPlanType::ALREADY_INSTALLED, InstallPlanType::BUILD_AND_INSTALL, InstallPlanType::INSTALL};
for (const InstallPlanType plan_type : order)
{
@@ -277,8 +276,7 @@ namespace vcpkg::Commands::Install
for (auto&& spec : specs)
Input::check_triplet(spec.triplet(), paths);
- const std::unordered_set<std::string> options =
- args.check_and_get_optional_command_arguments({ OPTION_DRY_RUN });
+ const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({OPTION_DRY_RUN});
const bool dryRun = options.find(OPTION_DRY_RUN) != options.cend();
// create the plan

MODIFY
src/commands_integrate.cpp
src/commands_integrate.cpp
@@ -10,8 +10,7 @@ namespace vcpkg::Commands::Integrate
{
static const std::array<fs::path, 2> old_system_target_files = {
System::get_ProgramFiles_32_bit() / "MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets",
- System::get_ProgramFiles_32_bit() / "MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets"
- };
+ System::get_ProgramFiles_32_bit() / "MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets"};
static const fs::path system_wide_targets_file =
System::get_ProgramFiles_32_bit() / "MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props";

MODIFY
src/commands_remove.cpp
src/commands_remove.cpp
@@ -89,8 +89,7 @@ namespace vcpkg::Commands::Remove
static void print_plan(const std::map<RemovePlanType, std::vector<const RemovePlanAction*>>& group_by_plan_type)
{
- static constexpr std::array<RemovePlanType, 2> order = { RemovePlanType::NOT_INSTALLED,
- RemovePlanType::REMOVE };
+ static constexpr std::array<RemovePlanType, 2> order = {RemovePlanType::NOT_INSTALLED, RemovePlanType::REMOVE};
for (const RemovePlanType plan_type : order)
{
@@ -135,8 +134,10 @@ namespace vcpkg::Commands::Remove
};
static constexpr Option options_table[] = {
- Option{ "--purge", SINGLE_WITH_NO }, Option{ "--recurse", SINGLE_WITH_NO },
- Option{ "--dry-run", SINGLE_WITH_NO }, Option{ "--outdated", SINGLE },
+ Option{"--purge", SINGLE_WITH_NO},
+ Option{"--recurse", SINGLE_WITH_NO},
+ Option{"--dry-run", SINGLE_WITH_NO},
+ Option{"--outdated", SINGLE},
Option{"--logfile", VALUE},
};

MODIFY
src/metrics.cpp
src/metrics.cpp
@@ -99,8 +99,8 @@ namespace vcpkg::Metrics
else if (ch < 0x20 || ch >= 0x80)
{
// Note: this treats incoming Strings as Latin-1
- static constexpr const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ static constexpr const char hex[16] = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
encoded.append("\\u00");
encoded.push_back(hex[ch / 16]);
encoded.push_back(hex[ch % 16]);

MODIFY
src/tests_paragraph.cpp
src/tests_paragraph.cpp
@@ -51,8 +51,7 @@ namespace UnitTest1
TEST_METHOD(SourceParagraph_Two_Depends)
{
- vcpkg::SourceParagraph pgh(
- { { "Source", "zlib" }, { "Version", "1.2.8" }, { "Build-Depends", "z, openssl" } });
+ vcpkg::SourceParagraph pgh({{"Source", "zlib"}, {"Version", "1.2.8"}, {"Build-Depends", "z, openssl"}});
Assert::AreEqual(size_t(2), pgh.depends.size());
Assert::AreEqual("z", pgh.depends[0].name.c_str());
@@ -89,10 +88,7 @@ namespace UnitTest1
TEST_METHOD(BinaryParagraph_Construct_Minimum)
{
vcpkg::BinaryParagraph pgh({
- { "Package", "zlib" },
- { "Version", "1.2.8" },
- { "Architecture", "x86-windows" },
- { "Multi-Arch", "same" },
+ {"Package", "zlib"}, {"Version", "1.2.8"}, {"Architecture", "x86-windows"}, {"Multi-Arch", "same"},
});
Assert::AreEqual("zlib", pgh.spec.name().c_str());
@@ -279,10 +275,7 @@ namespace UnitTest1
TEST_METHOD(BinaryParagraph_serialize_min)
{
vcpkg::BinaryParagraph pgh({
- { "Package", "zlib" },
- { "Version", "1.2.8" },
- { "Architecture", "x86-windows" },
- { "Multi-Arch", "same" },
+ {"Package", "zlib"}, {"Version", "1.2.8"}, {"Architecture", "x86-windows"}, {"Multi-Arch", "same"},
});
std::string ss = Strings::serialize(pgh);
auto pghs = vcpkg::Paragraphs::parse_paragraphs(ss).value_or_exit(VCPKG_LINE_INFO);

MODIFY
src/vcpkg_Dependencies.cpp
src/vcpkg_Dependencies.cpp
@@ -168,8 +168,7 @@ namespace vcpkg::Dependencies
? RequestType::USER_REQUESTED
: RequestType::AUTO_SELECTED;
auto it = status_db.find_installed(spec);
- if (it != status_db.end())
- return InstallPlanAction{ spec, { *it->get(), nullopt, nullopt }, request_type };
+ if (it != status_db.end()) return InstallPlanAction{spec, {*it->get(), nullopt, nullopt}, request_type};
Expected<BinaryParagraph> maybe_bpgh = Paragraphs::try_load_cached_package(paths, spec);
if (auto bpgh = maybe_bpgh.get())

MODIFY
src/vcpkglib.cpp
src/vcpkglib.cpp
@@ -207,8 +207,7 @@ namespace vcpkg
[](const std::string& file) { return file.back() == '/'; });
StatusParagraphAndAssociatedFiles pgh_and_files = {
- *pgh, SortedVector<std::string>(std::move(installed_files_of_current_pgh))
- };
+ *pgh, SortedVector<std::string>(std::move(installed_files_of_current_pgh))};
installed_files.push_back(std::move(pgh_and_files));
}

[clang-format] Cpp11BracedListStyle: true