[clang-format] Increase PenaltyReturnTypeOnItsOwnLine
MODIFY
.clang-format
.clang-format
@@ -27,5 +27,5 @@ Cpp11BracedListStyle: false
IndentCaseLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: All
-PenaltyReturnTypeOnItsOwnLine: 100
+PenaltyReturnTypeOnItsOwnLine: 1000
SpaceAfterTemplateKeyword: false
\ No newline at end of file

MODIFY
include/Paragraphs.h
include/Paragraphs.h
@@ -22,6 +22,6 @@ namespace vcpkg::Paragraphs
std::vector<SourceParagraph> load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir);
- std::map<std::string, VersionT>
- extract_port_names_and_versions(const std::vector<SourceParagraph>& source_paragraphs);
+ std::map<std::string, VersionT> extract_port_names_and_versions(
+ const std::vector<SourceParagraph>& source_paragraphs);
}

MODIFY
include/VcpkgCmdArguments.h
include/VcpkgCmdArguments.h
@@ -20,8 +20,8 @@ namespace vcpkg
std::string command;
std::vector<std::string> command_arguments;
- std::unordered_set<std::string>
- check_and_get_optional_command_arguments(const std::vector<std::string>& valid_options) const;
+ std::unordered_set<std::string> check_and_get_optional_command_arguments(
+ const std::vector<std::string>& valid_options) const;
void check_max_arg_count(const size_t expected_arg_count) const;
void check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const;

MODIFY
src/Paragraphs.cpp
src/Paragraphs.cpp
@@ -240,8 +240,8 @@ namespace vcpkg::Paragraphs
return output;
}
- std::map<std::string, VersionT>
- extract_port_names_and_versions(const std::vector<SourceParagraph>& source_paragraphs)
+ std::map<std::string, VersionT> extract_port_names_and_versions(
+ const std::vector<SourceParagraph>& source_paragraphs)
{
std::map<std::string, VersionT> names_and_versions;
for (const SourceParagraph& port : source_paragraphs)

MODIFY
src/PostBuildLint.cpp
src/PostBuildLint.cpp
@@ -495,8 +495,8 @@ namespace vcpkg::PostBuildLint
return LintStatus::ERROR_DETECTED;
}
- static LintStatus
- check_lib_files_are_available_if_dlls_are_available(const std::map<BuildPolicies, OptBool>& policies,
+ static LintStatus check_lib_files_are_available_if_dlls_are_available(
+ const std::map<BuildPolicies, OptBool>& policies,
const size_t lib_count,
const size_t dll_count,
const fs::path& lib_dir)

MODIFY
src/VcpkgCmdArguments.cpp
src/VcpkgCmdArguments.cpp
@@ -135,8 +135,8 @@ namespace vcpkg
return args;
}
- std::unordered_set<std::string>
- VcpkgCmdArguments::check_and_get_optional_command_arguments(const std::vector<std::string>& valid_options) const
+ std::unordered_set<std::string> VcpkgCmdArguments::check_and_get_optional_command_arguments(
+ const std::vector<std::string>& valid_options) const
{
std::unordered_set<std::string> output;
auto options_copy = this->optional_command_arguments;

MODIFY
src/commands_portsdiff.cpp
src/commands_portsdiff.cpp
@@ -42,8 +42,8 @@ namespace vcpkg::Commands::PortsDiff
std::vector<T> only_right;
};
- static std::vector<UpdatedPort>
- find_updated_ports(const std::vector<std::string>& ports,
+ static std::vector<UpdatedPort> find_updated_ports(
+ const std::vector<std::string>& ports,
const std::map<std::string, VersionT>& previous_names_and_versions,
const std::map<std::string, VersionT>& current_names_and_versions)
{

MODIFY
src/commands_remove.cpp
src/commands_remove.cpp
@@ -121,7 +121,26 @@ namespace vcpkg::Commands::Remove
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet)
{
- static const std::string OPTION_PURGE = "--purge";
+ enum SwitchType
+ {
+ SINGLE,
+ SINGLE_WITH_NO,
+ VALUE,
+ };
+
+ struct Option
+ {
+ CStringView name;
+ SwitchType type;
+ };
+
+ 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{ "--logfile", VALUE },
+ };
+
+ static constexpr CStringView OPTION_PURGE = "--purge";
static const std::string OPTION_NO_PURGE = "--no-purge";
static const std::string OPTION_RECURSE = "--recurse";
static const std::string OPTION_DRY_RUN = "--dry-run";

MODIFY
src/vcpkg_Files.cpp
src/vcpkg_Files.cpp
@@ -148,8 +148,10 @@ namespace vcpkg::Files
{
fs::stdfs::copy(oldpath, newpath, opts);
}
- virtual bool
- copy_file(const fs::path& oldpath, const fs::path& newpath, fs::copy_options opts, std::error_code& ec) override
+ virtual bool copy_file(const fs::path& oldpath,
+ const fs::path& newpath,
+ fs::copy_options opts,
+ std::error_code& ec) override
{
return fs::stdfs::copy_file(oldpath, newpath, opts, ec);
}

[clang-format] Increase PenaltyReturnTypeOnItsOwnLine