Skip to content

Commit

Permalink
Minor self CR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Jan 26, 2024
1 parent 6e3f487 commit 9fdf0e2
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 34 deletions.
1 change: 0 additions & 1 deletion include/vcpkg/base/diagnostics.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ namespace vcpkg
}

// If Ty is a std::unique_ptr<U>, typename AdaptContextDetectUniquePtr<Ty>::type is the type necessary to return
// and fwd is the type necessary to move if necessary. Otherwise, there are no members ::type or ::fwd
template<class Ty>
struct AdaptContextDetectUniquePtr
{
Expand Down
1 change: 0 additions & 1 deletion include/vcpkg/base/fwd/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ namespace vcpkg
};

struct ParseMessage;
struct ParseMessages;
struct ParserBase;
}
9 changes: 0 additions & 9 deletions include/vcpkg/base/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ namespace vcpkg
LocalizedString format(StringView origin, MessageKind kind) const;
};

struct ParseMessages
{
Optional<LocalizedString> error;
std::vector<ParseMessage> warnings;

void exit_if_errors_or_warnings(StringView origin) const;
bool good() const { return !error && warnings.empty(); }
};

struct ParserBase
{
ParserBase(DiagnosticContext& context, StringView text, StringView origin, TextRowCol init_rowcol = {1, 1});
Expand Down
4 changes: 2 additions & 2 deletions src/vcpkg-test/ci-baseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ bill-made-up-another-skip:x64-linux=skip)"; // note no trailing newline
}
else
{
FAIL();
FAIL(context.to_string());
}
}

Expand All @@ -219,7 +219,7 @@ bill-made-up-another-skip:x64-linux=skip)"; // note no trailing newline
}
else
{
FAIL();
FAIL(context.to_string());
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/vcpkg/base/diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ namespace
{
static constexpr StringLiteral ColonSpace{": "};

void append_file_prefix(std::string& target,
const Optional<std::string>& maybe_origin,
const TextRowCol& position)
void append_file_prefix(std::string& target, const Optional<std::string>& maybe_origin, const TextRowCol& position)
{
// file:line:col: kind: message
if (auto origin = maybe_origin.get())
Expand Down
18 changes: 0 additions & 18 deletions src/vcpkg/base/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,6 @@ namespace vcpkg
return res;
}

void ParseMessages::exit_if_errors_or_warnings(StringView origin) const
{
for (const auto& warning : warnings)
{
msg::println(warning.format(origin, MessageKind::Warning));
}

if (auto e = error.get())
{
Checks::msg_exit_with_message(VCPKG_LINE_INFO, *e);
}

if (!warnings.empty())
{
Checks::msg_exit_with_error(VCPKG_LINE_INFO, msgWarningsTreatedAsErrors);
}
}

ParserBase::ParserBase(DiagnosticContext& context, StringView text, StringView origin, TextRowCol init_rowcol)
: m_it(text.begin(), text.end())
, m_start_of_line(m_it)
Expand Down

0 comments on commit 9fdf0e2

Please sign in to comment.