clang-tidy: Enable a clang-analyzer and readability check

This commit enables clang-analyzer-deadcode.DeadStores check
which indicates that there are variables in your code that are
assigned values but are never used beyond that assignment.
The readability-static-accessed-through-instance check verifies
when a static member of a class is accessed through an instance
of that class rather than through the class itself.

But here this check is capturing an error on "serviceName"
even when the member is a constant and not a static member.
So just ignoring this check in the function.

Change-Id: I18b60a0800870ac8394f5a0754fbbac0cfd18c36
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
diff --git a/software_manager.cpp b/software_manager.cpp
index d362abf..15f7dbe 100644
--- a/software_manager.cpp
+++ b/software_manager.cpp
@@ -13,9 +13,10 @@
     auto path = std::string(SOFTWARE_OBJPATH) + "/bmc";
     sdbusplus::async::context ctx;
     sdbusplus::server::manager_t manager{ctx, path.c_str()};
-    constexpr auto serviceName = "xyz.openbmc_project.Software.Manager";
 
-    ctx.spawn([](sdbusplus::async::context& ctx) -> sdbusplus::async::task<> {
+    // NOLINTNEXTLINE(readability-static-accessed-through-instance)
+    ctx.spawn([=](sdbusplus::async::context& ctx) -> sdbusplus::async::task<> {
+        constexpr auto serviceName = "xyz.openbmc_project.Software.Manager";
         ctx.request_name(serviceName);
         co_return;
     }(ctx));