Skip to content

Commit 8e5bfc7

Browse files
morrisonleviclaude
andcommitted
style(appsec): clang-format-19 helper sources
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3ee2336 commit 8e5bfc7

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

appsec/src/helper/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool ensure_unique_abstract_socket(std::string_view socket_path)
104104
return false;
105105
}
106106

107-
struct sockaddr_un addr {};
107+
struct sockaddr_un addr{};
108108
addr.sun_family = AF_UNIX;
109109
addr.sun_path[0] = '\0';
110110

appsec/src/helper/network/acceptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ acceptor::acceptor(const std::string_view &sv)
2828
throw std::system_error(errno, std::generic_category());
2929
}
3030

31-
struct sockaddr_un addr {};
31+
struct sockaddr_un addr{};
3232
std::size_t addr_size;
3333
addr.sun_family = AF_UNIX;
3434
bool const is_abstract = (!sv.empty() && sv[0] == '@');
@@ -111,7 +111,7 @@ void acceptor::set_accept_timeout(std::chrono::seconds timeout)
111111

112112
std::unique_ptr<base_socket> acceptor::accept()
113113
{
114-
struct sockaddr_un addr {};
114+
struct sockaddr_un addr{};
115115
socklen_t len = sizeof(addr);
116116

117117
int s =

appsec/src/helper/rate_limit.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace dds {
1919
template <typename T> class rate_limiter {
2020
public:
2121
explicit rate_limiter(uint32_t max_per_second)
22-
: max_per_second_(max_per_second){};
22+
: max_per_second_(max_per_second) {};
2323
bool allow()
2424
{
2525
SPDLOG_TRACE("rate_limiter: allow() called");

appsec/src/helper/remote_config/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mapped_memory config::read() const
5757
auto close_fs = defer{[fd]() { ::close(fd); }};
5858

5959
// check that the uid of the shared memory segment is the same as ours
60-
struct ::stat shm_stat {};
60+
struct ::stat shm_stat{};
6161
if (::fstat(fd, &shm_stat) == -1) {
6262
throw std::runtime_error{
6363
"Call to fstat on memory segment failed: " + strerror_ts(errno)};

appsec/src/helper/remote_config/config.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ class parsed_config_key {
135135
std::string key_;
136136
std::string_view source_;
137137
std::uint64_t org_id_{};
138-
class product product_ {
139-
known_products::UNKNOWN
140-
};
138+
class product product_{known_products::UNKNOWN};
141139
std::string_view config_id_;
142140
std::string_view name_;
143141
};

appsec/src/helper/remote_config/listeners/asm_features_listener.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class asm_features_listener : public listener_base {
1717
public:
1818
explicit asm_features_listener(
1919
std::shared_ptr<dds::service_config> service_config)
20-
: service_config_(std::move(service_config)){};
20+
: service_config_(std::move(service_config)) {};
2121

2222
void init() override;
2323
void on_update(const config &config) override;

appsec/src/helper/runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ std::unique_ptr<network::base_acceptor> acceptor_from_config(
3838
if (sock_path.size() >= 4 && sock_path.substr(0, 3) == "fd:") {
3939
auto rest{sock_path.substr(3)};
4040
int const fd = std::stoi(std::string{rest}); // can throw
41-
struct stat statbuf {};
41+
struct stat statbuf{};
4242
int const res = fstat(fd, &statbuf);
4343
if (res == -1 || !S_ISSOCK(statbuf.st_mode)) {
4444
throw std::invalid_argument{

appsec/src/helper/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ std::string read_file(std::string_view filename)
2020
throw std::system_error(errno, std::generic_category());
2121
}
2222

23-
struct stat statbuf {};
23+
struct stat statbuf{};
2424
auto rc = stat(std::string{filename}.c_str(), &statbuf);
2525
auto file_size = rc == 0 ? statbuf.st_size : 0;
2626
std::string buffer(file_size, '\0');

appsec/tests/helper/engine_test.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,15 @@ TEST(EngineTest, WafDefaultActions)
279279

280280
auto listener = std::make_unique<mock::listener>();
281281
EXPECT_CALL(*listener, call(_, _, _))
282-
.WillRepeatedly(Invoke([](dds::parameter_view &data, dds::event &event_,
283-
const dds::network::request_exec_options
284-
&options) -> void {
285-
event_.actions.push_back({dds::action_type::redirect, {}});
286-
event_.actions.push_back({dds::action_type::block, {}});
287-
event_.actions.push_back({dds::action_type::stack_trace, {}});
288-
event_.actions.push_back({dds::action_type::extract_schema, {}});
289-
}));
282+
.WillRepeatedly(Invoke(
283+
[](dds::parameter_view &data, dds::event &event_,
284+
const dds::network::request_exec_options &options) -> void {
285+
event_.actions.push_back({dds::action_type::redirect, {}});
286+
event_.actions.push_back({dds::action_type::block, {}});
287+
event_.actions.push_back({dds::action_type::stack_trace, {}});
288+
event_.actions.push_back(
289+
{dds::action_type::extract_schema, {}});
290+
}));
290291

291292
auto sub = std::make_unique<mock::subscriber>();
292293
EXPECT_CALL(*sub, get_listener()).WillOnce(Invoke([&]() {

0 commit comments

Comments
 (0)