add clang-tidy
This commit implements a clang-tidy file, and makes some changes to get
it to pass. Most changes are naming or mechanical in nature.
Tested:
Clang-tidy now passes.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia441e4801b6c8725421d160c531c5df141f255d4
diff --git a/include/PSUSensor.hpp b/include/PSUSensor.hpp
index 7b4bfdb..0559073 100644
--- a/include/PSUSensor.hpp
+++ b/include/PSUSensor.hpp
@@ -1,14 +1,14 @@
#pragma once
-#include "PwmSensor.hpp"
-#include "Thresholds.hpp"
-#include "sensor.hpp"
-
+#include <PwmSensor.hpp>
+#include <Thresholds.hpp>
#include <boost/asio/streambuf.hpp>
#include <sdbusplus/asio/object_server.hpp>
+#include <sensor.hpp>
#include <memory>
#include <string>
+#include <utility>
class PSUSensor : public Sensor, public std::enable_shared_from_this<PSUSensor>
{
@@ -21,7 +21,7 @@
const std::string& sensorConfiguration,
std::string& sensorTypeName, unsigned int factor, double max,
double min, const std::string& label, size_t tSize);
- ~PSUSensor();
+ ~PSUSensor() override;
void setupRead(void);
private:
@@ -48,7 +48,7 @@
{
public:
PSUProperty(std::string name, double max, double min, unsigned int factor) :
- labelTypeName(name), maxReading(max), minReading(min),
+ labelTypeName(std::move(name)), maxReading(max), minReading(min),
sensorScaleFactor(factor)
{}
~PSUProperty() = default;