Skip to content

Commit 6a23418

Browse files
committed
lint
1 parent 40990da commit 6a23418

File tree

6 files changed

+46
-50
lines changed

6 files changed

+46
-50
lines changed

src/viam/sdk/services/discovery.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace sdk {
1414
/// @defgroup Discovery Classes related to the Discovery service.
1515

1616
/// @class Discovery discovery.hpp "services/discovery.hpp"
17-
/// @brief A `Discovery` service is used to discover resources that are physically connected to
17+
/// @brief A `Discovery` service is used to discover resources that are physically connected to
1818
/// your machine.
19-
/// @ingroup Discovery
19+
/// @ingroup Discovery
2020
///
2121
/// This acts as an abstract parent class to be inherited from by any drivers representing
2222
/// specific discovery implementations. This class cannot be used on its own.
@@ -29,8 +29,8 @@ class Discovery : public Service {
2929
return discover_resources({});
3030
}
3131

32-
/// @brief Discover valid viam configuration of resources that are physically
33-
/// connected to your machine.
32+
/// @brief Discover valid viam configuration of resources that are physically
33+
/// connected to your machine.
3434
virtual std::vector<ResourceConfig> discover_resources(const ProtoStruct& extra) = 0;
3535

3636
/// @brief Do an arbitrary command.
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <viam/sdk/services/private/discovery_client.hpp>
1+
#include <viam/sdk/services/private/discovery_client.hpp>
22

33
#include <viam/api/service/discovery/v1/discovery.grpc.pb.h>
44
#include <viam/api/service/discovery/v1/discovery.pb.h>
@@ -10,25 +10,23 @@ namespace sdk {
1010
namespace impl {
1111

1212
DiscoveryClient::DiscoveryClient(std::string name std::shared_ptr<grpc::Channel> channel)
13-
: Discovery(std::move(name)),
14-
stub_(viam::service::discovery::v1::DiscoveryService::NewStub(channel)),
15-
channel_(std::move(channel)) {}
16-
13+
: Discovery(std::move(name)),
14+
stub_(viam::service::discovery::v1::DiscoveryService::NewStub(channel)),
15+
channel_(std::move(channel)) {}
16+
1717
std::vector<ResourceConfig> DiscoveryClient::discover_resources(const ProtoStruct& extra) {
1818
return make_client_helper(this, *stub_, &StubType::DiscoverResources)
1919
.with(extra)
20-
.invoke([](auto& response) {return from_proto(response);});
20+
.invoke([](auto& response) { return from_proto(response); });
2121
}
2222

2323
ProtoStruct DiscoveryClient::do_command(const ProtoStruct& extra) {
2424
return make_client_helper(this, *stub_, &StubType::DoCommand)
25-
.with([&](auto& request) {*request.mutable_command() = to_proto(command); })
26-
.invoke([](auto& response) {return from_proto(response.result());});
25+
.with([&](auto& request) { *request.mutable_command() = to_proto(command); })
26+
.invoke([](auto& response) { return from_proto(response.result()); });
2727
}
2828

2929

30-
} // namespace impl
31-
32-
33-
} //namespace sdk
34-
} //namespace viam
30+
} // namespace impl
31+
} // namespace sdk
32+
} // namespace viam

src/viam/sdk/services/private/discovery_client.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ class DiscoveryClient : public Discovery {
3434
std::shared_ptr<grpc::Channel> channel_;
3535
};
3636

37-
} // namespace impl
38-
} // namespace sdk
39-
} // namespace viam
37+
} // namespace impl
38+
} // namespace sdk
39+
} // namespace viam

src/viam/sdk/services/private/discovery_server.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ::grpc::Status DiscoveryServer::DiscoverResources(
1515
::viam::service::discovery::v1::DiscoverResourcesResponse* response) noexcept {
1616
return make_service_helper<Discovery>(
1717
"DiscoveryServer::DiscoverResources", this, request)([&](auto& helper, auto& discovery) {
18-
const std::vector<ResourceConfig> resources = discovery->discover_resources(helper.getExtra());
18+
const std::vector<ResourceConfig> resources =
19+
discovery->discover_resources(helper.getExtra());
1920
for (const auto& resource : resources) {
2021
*response->mutable_resources()->Add() = to_proto(resource);
2122
}
@@ -33,6 +34,6 @@ ::grpc::Status DiscoveryServer::DoCommand(
3334
});
3435
}
3536

36-
} // namespace impl
37-
} // namespace sdk
38-
} // namespace viam
37+
} // namespace impl
38+
} // namespace sdk
39+
} // namespace viam

src/viam/sdk/tests/mocks/mock_discovery.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class MockDiscovery : public sdk::Discovery {
2121

2222
} // namespace discovery
2323
} // namespace sdktests
24-
} // namespace viam
24+
} // namespace viam
2525

src/viam/sdk/tests/test_utils.cpp

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,28 @@ std::vector<GeometryConfig> fake_geometries() {
2828

2929
std::vector<ResourceConfig> fake_discovered_resources() {
3030
return {
31-
ResourceConfig(
32-
"camera",
33-
"mycam",
34-
"rdk",
35-
{{"width", 640}, {"height", 480}, {"format", "mjpeg"}},
36-
"rdk:component:camera",
37-
"rdk:builtin:webcam"),
38-
ResourceConfig(
39-
"motor",
40-
"arm_motor",
41-
"rand",
42-
{
43-
{"pins", {{"pwm", 18}, {"dir", 23}}},
44-
{"max_rpm", 100},
45-
{"encoder_steps", 200},
46-
},
47-
"rdk:component:motor",
48-
"rand:cool:motor"),
49-
ResourceConfig(
50-
"sensor",
51-
"temp_sensor",
52-
"viam",
53-
{{"type", "temperature"}, {"unit", "celsius"}, {"poll_rate", 1000}},
54-
"rdk:component:sensor",
55-
"viam:temp:sensor1"),
31+
ResourceConfig( "camera",
32+
"mycam",
33+
"rdk",
34+
{{"width", 640}, {"height", 480}, {"format", "mjpeg"}},
35+
"rdk:component:camera",
36+
"rdk:builtin:webcam"),
37+
ResourceConfig( "motor",
38+
"arm_motor",
39+
"rand",
40+
{
41+
{"pins", {{"pwm", 18}, {"dir", 23}}},
42+
{"max_rpm", 100},
43+
{"encoder_steps", 200},
44+
},
45+
"rdk:component:motor",
46+
"rand:cool:motor"),
47+
ResourceConfig( "sensor",
48+
"temp_sensor",
49+
"viam",
50+
{{"type", "temperature"}, {"unit", "celsius"}, {"poll_rate", 1000}},
51+
"rdk:component:sensor",
52+
"viam:temp:sensor1"),
5653
};
5754
}
5855

0 commit comments

Comments
 (0)