clang-tidy: Enable bugprone-unused-local-non-tri
Modified code to address issues flagged by
bugprone-unused-local-non-trivial-variable check.
Tested: Build and unit tests passed successfully.
Change-Id: I21eca96e7582d24af398fb502540e0b51b0ca7fa
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/.clang-tidy b/.clang-tidy
index 3542c7f..7dd1df1 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -73,6 +73,7 @@
bugprone-unhandled-self-assignment,
bugprone-unique-ptr-array-mismatch,
bugprone-unsafe-functions,
+bugprone-unused-local-non-trivial-variable,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
diff --git a/certs_manager.cpp b/certs_manager.cpp
index cf61d4f..2084f3a 100644
--- a/certs_manager.cpp
+++ b/certs_manager.cpp
@@ -311,8 +311,6 @@
lg2::info("Starts authority list install");
fs::path authorityStore(certInstallPath);
- fs::path authoritiesListFile =
- authorityStore / defaultAuthoritiesListFileName;
// Atomically install all the certificates
fs::path tempPath = Certificate::generateUniqueFilePath(authorityStore);
diff --git a/test/certs_manager_test.cpp b/test/certs_manager_test.cpp
index 08a7bb5..021c93c 100644
--- a/test/certs_manager_test.cpp
+++ b/test/certs_manager_test.cpp
@@ -998,7 +998,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1067,7 +1066,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1115,7 +1113,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1162,7 +1159,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1208,7 +1204,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1255,7 +1250,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1305,7 +1299,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1351,7 +1344,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};
@@ -1402,7 +1394,6 @@
std::string unit;
CertificateType type = CertificateType::server;
std::string installPath(certDir + "/" + certificateFile);
- std::string verifyPath(installPath);
std::string csrPath(certDir + "/" + CSRFile);
std::string privateKeyPath(certDir + "/" + privateKeyFile);
std::vector<std::string> alternativeNames{"localhost1", "localhost2"};