Enable cppcoreguidelines-init-variables
We try to enforce this rule, but clearly the robot can do a better job.
Enable the rule, and for init of all variables that clang-tidy finds in
error.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icf64bc51b3180de29f7e92fa5c5f636e6b1462a6
diff --git a/src/ExternalSensorMain.cpp b/src/ExternalSensorMain.cpp
index 1ced726..477a4c6 100644
--- a/src/ExternalSensorMain.cpp
+++ b/src/ExternalSensorMain.cpp
@@ -185,9 +185,6 @@
const SensorBaseConfigMap& baseConfigMap =
baseConfiguration.second;
- double minValue;
- double maxValue;
-
// MinValue and MinValue are mandatory numeric parameters
auto minFound = baseConfigMap.find("MinValue");
if (minFound == baseConfigMap.end())
@@ -196,7 +193,7 @@
<< interfacePath << "\n";
continue;
}
- minValue =
+ double minValue =
std::visit(VariantToDoubleVisitor(), minFound->second);
if (!std::isfinite(minValue))
{
@@ -212,7 +209,7 @@
<< interfacePath << "\n";
continue;
}
- maxValue =
+ double maxValue =
std::visit(VariantToDoubleVisitor(), maxFound->second);
if (!std::isfinite(maxValue))
{