clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I81aff1005be025ddb4405f384513c8e5e20bf6f4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/Utils.cpp b/src/Utils.cpp
index b305c3c..2af6b50 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -347,9 +347,9 @@
return true;
}
-static void
- getPowerStatus(const std::shared_ptr<sdbusplus::asio::connection>& conn,
- size_t retries = 2)
+static void getPowerStatus(
+ const std::shared_ptr<sdbusplus::asio::connection>& conn,
+ size_t retries = 2)
{
conn->async_method_call(
[conn, retries](boost::system::error_code ec,
@@ -380,9 +380,9 @@
power::interface, power::property);
}
-static void
- getPostStatus(const std::shared_ptr<sdbusplus::asio::connection>& conn,
- size_t retries = 2)
+static void getPostStatus(
+ const std::shared_ptr<sdbusplus::asio::connection>& conn,
+ size_t retries = 2)
{
conn->async_method_call(
[conn, retries](boost::system::error_code ec,
@@ -415,9 +415,9 @@
post::interface, post::property);
}
-static void
- getChassisStatus(const std::shared_ptr<sdbusplus::asio::connection>& conn,
- size_t retries = 2)
+static void getChassisStatus(
+ const std::shared_ptr<sdbusplus::asio::connection>& conn,
+ size_t retries = 2)
{
conn->async_method_call(
[conn, retries](boost::system::error_code ec,
@@ -718,8 +718,8 @@
return std::nullopt;
}
-std::optional<std::tuple<std::string, std::string, std::string>>
- splitFileName(const std::filesystem::path& filePath)
+std::optional<std::tuple<std::string, std::string, std::string>> splitFileName(
+ const std::filesystem::path& filePath)
{
if (filePath.has_filename())
{
diff --git a/src/Utils.hpp b/src/Utils.hpp
index fe1f478..be96877 100644
--- a/src/Utils.hpp
+++ b/src/Utils.hpp
@@ -384,8 +384,8 @@
// The common scheme for sysfs files naming is: <type><number>_<item>.
// This function returns optionally these 3 elements as a tuple.
-std::optional<std::tuple<std::string, std::string, std::string>>
- splitFileName(const std::filesystem::path& filePath);
+std::optional<std::tuple<std::string, std::string, std::string>> splitFileName(
+ const std::filesystem::path& filePath);
std::optional<double> readFile(const std::string& thresholdFile,
const double& scaleFactor);
void setupManufacturingModeMatch(sdbusplus::asio::connection& conn);
diff --git a/src/external/ExternalSensor.cpp b/src/external/ExternalSensor.cpp
index 305fd82..506823a 100644
--- a/src/external/ExternalSensor.cpp
+++ b/src/external/ExternalSensor.cpp
@@ -142,8 +142,8 @@
return (ageElapsed(now) < writeTimeout);
}
-void
- ExternalSensor::writeBegin(const std::chrono::steady_clock::time_point& now)
+void ExternalSensor::writeBegin(
+ const std::chrono::steady_clock::time_point& now)
{
if (!writeAlive)
{
diff --git a/src/external/ExternalSensor.hpp b/src/external/ExternalSensor.hpp
index 495c596..0675815 100644
--- a/src/external/ExternalSensor.hpp
+++ b/src/external/ExternalSensor.hpp
@@ -37,8 +37,8 @@
bool isAliveAndPerishable() const;
// Returns true if AliveAndPerishable and timeout has not yet happened
- bool
- isAliveAndFresh(const std::chrono::steady_clock::time_point& now) const;
+ bool isAliveAndFresh(
+ const std::chrono::steady_clock::time_point& now) const;
// Marks the time when Value successfully received from external source
void writeBegin(const std::chrono::steady_clock::time_point& now);
@@ -47,12 +47,12 @@
void writeInvalidate();
// Returns amount of time elapsed since last writeBegin() happened
- std::chrono::steady_clock::duration
- ageElapsed(const std::chrono::steady_clock::time_point& now) const;
+ std::chrono::steady_clock::duration ageElapsed(
+ const std::chrono::steady_clock::time_point& now) const;
// Returns amount of time remaining until sensor timeout will happen
- std::chrono::steady_clock::duration
- ageRemaining(const std::chrono::steady_clock::time_point& now) const;
+ std::chrono::steady_clock::duration ageRemaining(
+ const std::chrono::steady_clock::time_point& now) const;
private:
sdbusplus::asio::object_server& objServer;
diff --git a/src/fan/PresenceGpio.hpp b/src/fan/PresenceGpio.hpp
index ac42638..1975785 100644
--- a/src/fan/PresenceGpio.hpp
+++ b/src/fan/PresenceGpio.hpp
@@ -87,7 +87,7 @@
private:
boost::asio::steady_timer pollTimer;
- static inline void
- pollTimerHandler(const std::weak_ptr<PollingPresenceGpio>& weakRef,
- const boost::system::error_code& ec);
+ static inline void pollTimerHandler(
+ const std::weak_ptr<PollingPresenceGpio>& weakRef,
+ const boost::system::error_code& ec);
};
diff --git a/src/hwmon-temp/HwmonTempMain.cpp b/src/hwmon-temp/HwmonTempMain.cpp
index a9ec2c1..1ec199f 100644
--- a/src/hwmon-temp/HwmonTempMain.cpp
+++ b/src/hwmon-temp/HwmonTempMain.cpp
@@ -97,8 +97,8 @@
{"W83773G", I2CDeviceType{"w83773g", true}},
};
-static struct SensorParams
- getSensorParameters(const std::filesystem::path& path)
+static struct SensorParams getSensorParameters(
+ const std::filesystem::path& path)
{
// offset is to default to 0 and scale to 1, see lore
// https://lore.kernel.org/linux-iio/5c79425f-6e88-36b6-cdfe-4080738d039f@metafoo.de/
@@ -205,8 +205,8 @@
using SensorConfigMap =
boost::container::flat_map<SensorConfigKey, SensorConfig>;
-static SensorConfigMap
- buildSensorConfigMap(const ManagedObjectType& sensorConfigs)
+static SensorConfigMap buildSensorConfigMap(
+ const ManagedObjectType& sensorConfigs)
{
SensorConfigMap configMap;
for (const auto& [path, cfgData] : sensorConfigs)
diff --git a/src/mctp/MCTPDeviceRepository.hpp b/src/mctp/MCTPDeviceRepository.hpp
index 6602ea7..ca67547 100644
--- a/src/mctp/MCTPDeviceRepository.hpp
+++ b/src/mctp/MCTPDeviceRepository.hpp
@@ -62,8 +62,8 @@
return lookup(device) != devices.end();
}
- std::optional<std::string>
- inventoryFor(const std::shared_ptr<MCTPDevice>& device)
+ std::optional<std::string> inventoryFor(
+ const std::shared_ptr<MCTPDevice>& device)
{
auto entry = lookup(device);
if (entry == devices.end())
diff --git a/src/mctp/MCTPEndpoint.cpp b/src/mctp/MCTPEndpoint.cpp
index 870e708..5eb114e 100644
--- a/src/mctp/MCTPEndpoint.cpp
+++ b/src/mctp/MCTPEndpoint.cpp
@@ -318,8 +318,8 @@
return dev;
}
-std::optional<SensorBaseConfigMap>
- I2CMCTPDDevice::match(const SensorData& config)
+std::optional<SensorBaseConfigMap> I2CMCTPDDevice::match(
+ const SensorData& config)
{
auto iface = config.find(configInterfaceName(configType));
if (iface == config.end())
diff --git a/src/mctp/MCTPEndpoint.hpp b/src/mctp/MCTPEndpoint.hpp
index 9205eb1..ffba380 100644
--- a/src/mctp/MCTPEndpoint.hpp
+++ b/src/mctp/MCTPEndpoint.hpp
@@ -163,10 +163,10 @@
* the request was successful then @p ep contains a
* valid MctpEndpoint instance.
*/
- virtual void
- setup(std::function<void(const std::error_code& ec,
- const std::shared_ptr<MCTPEndpoint>& ep)>&&
- added) = 0;
+ virtual void setup(
+ std::function<void(const std::error_code& ec,
+ const std::shared_ptr<MCTPEndpoint>& ep)>&&
+ added) = 0;
/**
* @brief Remove the device and any associated endpoint from the MCTP stack.
@@ -309,9 +309,9 @@
public:
static std::optional<SensorBaseConfigMap> match(const SensorData& config);
static bool match(const std::set<std::string>& interfaces);
- static std::shared_ptr<I2CMCTPDDevice>
- from(const std::shared_ptr<sdbusplus::asio::connection>& connection,
- const SensorBaseConfigMap& iface);
+ static std::shared_ptr<I2CMCTPDDevice> from(
+ const std::shared_ptr<sdbusplus::asio::connection>& connection,
+ const SensorBaseConfigMap& iface);
I2CMCTPDDevice() = delete;
I2CMCTPDDevice(
diff --git a/src/nvme/NVMeBasicContext.cpp b/src/nvme/NVMeBasicContext.cpp
index 64549a4..18ec078 100644
--- a/src/nvme/NVMeBasicContext.cpp
+++ b/src/nvme/NVMeBasicContext.cpp
@@ -47,8 +47,8 @@
* https://nvmexpress.org/wp-content/uploads/NVMe_Management_-_Technical_Note_on_Basic_Management_Command.pdf
*/
-static std::shared_ptr<std::array<uint8_t, 6>>
- encodeBasicQuery(int bus, uint8_t device, uint8_t offset)
+static std::shared_ptr<std::array<uint8_t, 6>> encodeBasicQuery(
+ int bus, uint8_t device, uint8_t offset)
{
if (bus < 0)
{
diff --git a/src/nvme/NVMeContext.hpp b/src/nvme/NVMeContext.hpp
index e2ada1b..cb5d062 100644
--- a/src/nvme/NVMeContext.hpp
+++ b/src/nvme/NVMeContext.hpp
@@ -37,8 +37,8 @@
sensors.emplace_back(sensor);
}
- std::optional<std::shared_ptr<NVMeSensor>>
- getSensorAtPath(const std::string& path)
+ std::optional<std::shared_ptr<NVMeSensor>> getSensorAtPath(
+ const std::string& path)
{
for (auto& sensor : sensors)
{
diff --git a/src/psu/PSUSensorMain.cpp b/src/psu/PSUSensorMain.cpp
index ea853ad..0df7d41 100644
--- a/src/psu/PSUSensorMain.cpp
+++ b/src/psu/PSUSensorMain.cpp
@@ -996,8 +996,8 @@
}
}
-static void
- getPresentCpus(std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
+static void getPresentCpus(
+ std::shared_ptr<sdbusplus::asio::connection>& dbusConnection)
{
static const int depth = 2;
static const int numKeys = 1;
diff --git a/src/sensor.hpp b/src/sensor.hpp
index 039635f..2eab853 100644
--- a/src/sensor.hpp
+++ b/src/sensor.hpp
@@ -130,8 +130,8 @@
thresholds::thresProp.size()>
thresholdInterfaces;
- std::shared_ptr<sdbusplus::asio::dbus_interface>
- getThresholdInterface(Level lev)
+ std::shared_ptr<sdbusplus::asio::dbus_interface> getThresholdInterface(
+ Level lev)
{
size_t index = static_cast<size_t>(lev);
if (index >= thresholdInterfaces.size())