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/src/TachSensor.cpp b/src/TachSensor.cpp
index 0490135..bffc30e 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -14,12 +14,10 @@
// limitations under the License.
*/
-#include "TachSensor.hpp"
-
-#include "Utils.hpp"
-
#include <unistd.h>
+#include <TachSensor.hpp>
+#include <Utils.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/asio/read_until.hpp>
@@ -48,12 +46,12 @@
std::unique_ptr<PresenceSensor>&& presenceSensor,
std::optional<RedundancySensor>* redundancy,
boost::asio::io_service& io, const std::string& fanName,
- std::vector<thresholds::Threshold>&& _thresholds,
+ std::vector<thresholds::Threshold>&& thresholds,
const std::string& sensorConfiguration,
const std::pair<size_t, size_t>& limits,
const PowerState& powerState,
const std::optional<std::string>& ledIn) :
- Sensor(boost::replace_all_copy(fanName, " ", "_"), std::move(_thresholds),
+ Sensor(boost::replace_all_copy(fanName, " ", "_"), std::move(thresholds),
sensorConfiguration, objectType, limits.second, limits.first, conn,
powerState),
objServer(objectServer), redundancy(redundancy),
@@ -255,7 +253,7 @@
{
return; // we're being destroyed
}
- else if (ec)
+ if (ec)
{
std::cerr << "Error on presence sensor " << name
<< " \n";
@@ -330,7 +328,7 @@
newState = redundancy::failed;
break;
}
- else if (failedCount)
+ if (failedCount)
{
newState = redundancy::degraded;
}