Skip to content

Commit

Permalink
linter noise
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Sep 3, 2024
1 parent 65b3fa9 commit a9ffde2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions contract-tests/server-contract-tests/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ int main(int argc, char* argv[]) {
std::string port = default_port;
if (argc == 2) {
port =
argv[1]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
argv[1]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
}

try {
net::io_context ioc{1};

auto p = boost::lexical_cast<unsigned short>(port);
server srv(ioc, "0.0.0.0", p, logger);
auto const p = boost::lexical_cast<unsigned short>(port);
server srv{ioc, "0.0.0.0", p, logger};

srv.add_capability("server-side");
srv.add_capability("strongly-typed");
Expand All @@ -57,11 +57,12 @@ int main(int argc, char* argv[]) {

ioc.run();
LD_LOG(logger, LogLevel::kInfo) << "bye!";

} catch (boost::bad_lexical_cast&) {
LD_LOG(logger, LogLevel::kError)
<< "invalid port (" << port
<< "), provide a number (no arguments defaults "
"to port "
"to port "
<< default_port << ")";
return EXIT_FAILURE;
} catch (std::exception const& e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ bool ValidateFilterKey(std::string const& filter_key) {
}
try {
return regex_search(filter_key,
boost::regex(
"^[a-zA-Z0-9][._\\-a-zA-Z0-9]*$"));
boost::regex("^[a-zA-Z0-9][._\\-a-zA-Z0-9]*$"));
} catch (boost::bad_expression) {
// boost::bad_expression can be thrown by basic_regex when compiling a
// regular expression.
Expand All @@ -21,4 +20,4 @@ bool ValidateFilterKey(std::string const& filter_key) {
return false;
}
}
} // namespace launchdarkly::server_side::data_systems::detail
} // namespace launchdarkly::server_side::data_systems::detail
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void PollingDataSource::HandlePollResult(network::HttpResult const& res) {
DataSourceStatus::DataSourceState::kInterrupted,
DataSourceStatus::ErrorInfo::ErrorKind::kUnknown,
"polling response contained no body.");

} else if (res.Status() == 304) {
// This should be handled ahead of here, but if we get a 304,
// and it didn't have an etag, we still don't want to try to
Expand Down Expand Up @@ -250,4 +251,5 @@ void PollingDataSource::ShutdownAsync(std::function<void()> completion) {
boost::asio::post(timer_.get_executor(), completion);
}
}

} // namespace launchdarkly::server_side::data_systems
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <utility>

namespace launchdarkly::server_side::data_systems {

static char const* const kCouldNotParseEndpoint =
"Could not parse streaming endpoint URL";

Expand Down

0 comments on commit a9ffde2

Please sign in to comment.