Update clang-tidy

Fix a bunch of minor issues, ignore others.  We use a lot of global
variables.  Enabling a check will hopefully make sure we don't add more.

Change-Id: Ie76053d4afc95a5372b70b2fb768be464468cec0
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/src/entity_manager.cpp b/src/entity_manager.cpp
index f023e64..0b519e0 100644
--- a/src/entity_manager.cpp
+++ b/src/entity_manager.cpp
@@ -68,6 +68,7 @@
                  int64_t, uint64_t, double, int32_t, uint32_t, int16_t,
                  uint16_t, uint8_t, bool>;
 
+// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables)
 // store reference to all interfaces so we can destroy them later
 boost::container::flat_map<
     std::string, std::vector<std::weak_ptr<sdbusplus::asio::dbus_interface>>>
@@ -79,6 +80,7 @@
 Topology topology;
 
 boost::asio::io_context io;
+// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
 
 const std::regex illegalDbusPathRegex("[^A-Za-z0-9_.]");
 const std::regex illegalDbusMemberRegex("[^A-Za-z0-9_]");
diff --git a/src/fru_device.cpp b/src/fru_device.cpp
index 134d355..05f12bf 100644
--- a/src/fru_device.cpp
+++ b/src/fru_device.cpp
@@ -72,6 +72,8 @@
 
 const static constexpr char* i2CDevLocation = "/dev";
 
+// TODO Refactor these to not be globals
+// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables)
 static boost::container::flat_map<size_t, std::optional<std::set<size_t>>>
     busBlocklist;
 struct FindDevicesWithCallback;
@@ -84,6 +86,7 @@
 static boost::container::flat_map<size_t, std::set<size_t>> fruAddresses;
 
 boost::asio::io_context io;
+// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
 
 bool updateFRUProperty(
     const std::string& updatePropertyReq, uint32_t bus, uint32_t address,
@@ -621,13 +624,13 @@
                     auto addresses =
                         addressData.get<std::set<std::string_view>>();
 
-                    busBlocklist[bus].emplace();
+                    auto& block = busBlocklist[bus].emplace();
                     for (const auto& address : addresses)
                     {
                         size_t addressInt = 0;
                         std::from_chars(address.begin() + 2, address.end(),
                                         addressInt, 16);
-                        busBlocklist[bus]->insert(addressInt);
+                        block.insert(addressInt);
                     }
                 }
                 else
@@ -1416,6 +1419,7 @@
                 case IN_CREATE:
                 case IN_MOVED_TO:
                 case IN_DELETE:
+                {
                     std::string_view name(&iEvent->name[0], iEvent->len);
                     if (boost::starts_with(name, "i2c"))
                     {
@@ -1438,6 +1442,10 @@
                                      unknownBusObjectCount, powerIsOn,
                                      objServer, systemBus);
                     }
+                }
+                break;
+                default:
+                    break;
             }
             index += sizeof(inotify_event) + iEvent->len;
         }
diff --git a/src/fru_utils.cpp b/src/fru_utils.cpp
index e18d55b..6e6ba84 100644
--- a/src/fru_utils.cpp
+++ b/src/fru_utils.cpp
@@ -191,6 +191,11 @@
             }
         }
         break;
+
+        default:
+        {
+            return make_pair(DecodeState::err, value);
+        }
     }
 
     return make_pair(DecodeState::ok, value);
diff --git a/src/fru_utils.hpp b/src/fru_utils.hpp
index d6c2f6e..f6552a5 100644
--- a/src/fru_utils.hpp
+++ b/src/fru_utils.hpp
@@ -38,6 +38,7 @@
 using DeviceMap = boost::container::flat_map<int, std::vector<uint8_t>>;
 using BusMap = boost::container::flat_map<int, std::shared_ptr<DeviceMap>>;
 
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 inline BusMap busMap;
 
 enum class DecodeState
diff --git a/src/overlay.cpp b/src/overlay.cpp
index f60f554..8df8c8f 100644
--- a/src/overlay.cpp
+++ b/src/overlay.cpp
@@ -41,7 +41,7 @@
 
 constexpr const bool debug = false;
 
-std::regex illegalNameRegex("[^A-Za-z0-9_]");
+const std::regex illegalNameRegex("[^A-Za-z0-9_]");
 
 // helper function to make json types into string
 std::string jsonToString(const nlohmann::json& in)
diff --git a/src/perform_scan.cpp b/src/perform_scan.cpp
index 5e5b715..c503d99 100644
--- a/src/perform_scan.cpp
+++ b/src/perform_scan.cpp
@@ -24,11 +24,13 @@
 #include <charconv>
 
 /* Hacks from splitting entity_manager.cpp */
+// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables)
 extern std::shared_ptr<sdbusplus::asio::connection> systemBus;
 extern nlohmann::json lastJson;
 extern void
     propertiesChangedCallback(nlohmann::json& systemConfiguration,
                               sdbusplus::asio::object_server& objServer);
+// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
 
 using GetSubTreeType = std::vector<
     std::pair<std::string,
diff --git a/src/utils.cpp b/src/utils.cpp
index bac2a4b..6ff7a2b 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -42,7 +42,9 @@
 constexpr const char* templateChar = "$";
 
 namespace fs = std::filesystem;
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 static bool powerStatusOn = false;
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 static std::unique_ptr<sdbusplus::bus::match_t> powerMatch = nullptr;
 
 bool findFiles(const fs::path& dirPath, const std::string& matchString,
diff --git a/src/utils.hpp b/src/utils.hpp
index dec8508..57c787f 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -30,6 +30,7 @@
 constexpr const char* versionHashFile = "/var/configuration/version";
 constexpr const char* versionFile = "/etc/os-release";
 
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 extern boost::asio::io_context io;
 
 using DBusValueVariant =