Fix clang-tidy header check

Apparently our exclusion of the linux headers covered up some issues in
our own headers, and was erroneously ignoring all headers, not just the
linux headers.

Apparently this now detects recursion quite a bit, so disable that check
for the moment, as well as the special member variables checks.  Also,
disable some cert checks that are duplicates of
bugprone-reserved-identifier, because of the aformentioned ignored linux
headers

All other changes are done automatically.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie640495146dbe155a85d8a9e81be78539137a88b
diff --git a/.clang-tidy b/.clang-tidy
index 9386f6a..9c541aa 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -56,9 +56,7 @@
 cert-dcl03-c,
 cert-dcl16-c,
 cert-dcl21-cpp,
-cert-dcl37-c,
 cert-dcl50-cpp,
-cert-dcl51-cpp,
 cert-dcl54-cpp,
 cert-dcl58-cpp,
 cert-dcl59-cpp,
@@ -189,9 +187,7 @@
 clang-analyzer-webkit.RefCntblBaseVirtualDtor,
 cppcoreguidelines-avoid-c-arrays,
 cppcoreguidelines-init-variables,
-cppcoreguidelines-special-member-functions,
 misc-misplaced-const,
-misc-no-recursion,
 misc-redundant-expression,
 misc-static-assert,
 misc-throw-by-value-catch-by-reference,
@@ -252,7 +248,7 @@
 readability-identifier-naming'
 
 WarningsAsErrors: '*'
-HeaderFilterRegex: '^((?!linux).)*$'
+HeaderFilterRegex: '.*'
 CheckOptions:
   - { key: readability-identifier-naming.ClassCase,     value: CamelCase  }
   - { key: readability-identifier-naming.VariableCase,  value: camelBack }
@@ -260,4 +256,5 @@
   - { key: readability-identifier-naming.ParameterCase, value: camelBack }
   - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
   - { key: readability-identifier-naming.StructCase,    value: CamelCase  }
-
+  - { key: readability-identifier-naming.StructIgnoredRegexp,    value: ((peci_xfer_msg)|(peci_ping_msg)|(peci_get_dib_msg)|(peci_get_temp_msg)|(peci_rd_pkg_cfg_msg)|(peci_wr_pkg_cfg_msg)|(peci_rd_ia_msr_msg)|(peci_wr_ia_msr_msg)|(peci_rd_ia_msrex_msg)|(peci_rd_pci_cfg_msg)|(peci_wr_pci_cfg_msg)|(peci_rd_pci_cfg_local_msg)|(peci_wr_pci_cfg_local_msg)|(peci_rd_end_pt_cfg_msg)|(peci_wr_end_pt_cfg_msg)|(peci_crashdump_disc_msg)|(peci_crashdump_get_frame_msg))  }
+  - { key: bugprone-reserved-identifier.AllowedIdentifiers,    value: __PECI_IOCTL_H }
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
index 84a1e32..3f16069 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -93,7 +93,7 @@
         return false;
     }
 
-    bool resp;
+    bool resp = false;
     try
     {
         line.request({"cpusensor", gpiod::line_request::DIRECTION_INPUT,
diff --git a/include/ExternalSensor.hpp b/include/ExternalSensor.hpp
index a8b48e5..3ca3c8a 100644
--- a/include/ExternalSensor.hpp
+++ b/include/ExternalSensor.hpp
@@ -23,7 +23,7 @@
                    const std::string& sensorConfiguration, double maxReading,
                    double minReading, double timeoutSecs,
                    const PowerState& powerState);
-    virtual ~ExternalSensor();
+    ~ExternalSensor() override;
 
     // Call this immediately after calling the constructor
     void initWriteHook(
diff --git a/include/NVMeBasicContext.hpp b/include/NVMeBasicContext.hpp
index 579030e..29b55d9 100644
--- a/include/NVMeBasicContext.hpp
+++ b/include/NVMeBasicContext.hpp
@@ -9,10 +9,10 @@
 {
   public:
     NVMeBasicContext(boost::asio::io_service& io, int rootBus);
-    virtual ~NVMeBasicContext() = default;
-    virtual void pollNVMeDevices() override;
-    virtual void readAndProcessNVMeSensor() override;
-    virtual void processResponse(void* msg, size_t len) override;
+    ~NVMeBasicContext() override = default;
+    void pollNVMeDevices() override;
+    void readAndProcessNVMeSensor() override;
+    void processResponse(void* msg, size_t len) override;
 
   private:
     NVMeBasicContext(boost::asio::io_service& io, int rootBus, int cmdOut,
diff --git a/include/NVMeContext.hpp b/include/NVMeContext.hpp
index 96157e3..27c1720 100644
--- a/include/NVMeContext.hpp
+++ b/include/NVMeContext.hpp
@@ -19,7 +19,7 @@
         close();
     }
 
-    void addSensor(std::shared_ptr<NVMeSensor> sensor)
+    void addSensor(const std::shared_ptr<NVMeSensor>& sensor)
     {
         sensors.emplace_back(sensor);
     }
@@ -38,7 +38,7 @@
         return std::nullopt;
     }
 
-    void removeSensor(std::shared_ptr<NVMeSensor> sensor)
+    void removeSensor(const std::shared_ptr<NVMeSensor>& sensor)
     {
         sensors.remove(sensor);
     }
diff --git a/include/NVMeMCTPContext.hpp b/include/NVMeMCTPContext.hpp
index 656e1fd..8af3e8d 100644
--- a/include/NVMeMCTPContext.hpp
+++ b/include/NVMeMCTPContext.hpp
@@ -9,12 +9,12 @@
   public:
     NVMeMCTPContext(boost::asio::io_service& io, int rootBus);
 
-    virtual ~NVMeMCTPContext();
+    ~NVMeMCTPContext() override;
 
-    virtual void pollNVMeDevices() override;
-    virtual void close() override;
-    virtual void readAndProcessNVMeSensor() override;
-    virtual void processResponse(void* msg, size_t len) override;
+    void pollNVMeDevices() override;
+    void close() override;
+    void readAndProcessNVMeSensor() override;
+    void processResponse(void* msg, size_t len) override;
 
   private:
     boost::asio::ip::tcp::socket nvmeSlaveSocket;
@@ -23,7 +23,7 @@
     void readResponse();
 };
 
-namespace nvmeMCTP
+namespace nvme_mctp
 {
 void init(void);
 }
diff --git a/include/NVMeSensor.hpp b/include/NVMeSensor.hpp
index 48ffc25..d713211 100644
--- a/include/NVMeSensor.hpp
+++ b/include/NVMeSensor.hpp
@@ -6,7 +6,7 @@
 class NVMeSensor : public Sensor
 {
   public:
-    static constexpr const char* CONFIG_TYPE =
+    static constexpr const char* configType =
         "xyz.openbmc_project.Configuration.NVME1000";
 
     NVMeSensor(sdbusplus::asio::object_server& objectServer,
@@ -15,7 +15,7 @@
                const std::string& sensorName,
                std::vector<thresholds::Threshold>&& thresholds,
                const std::string& sensorConfiguration, const int busNumber);
-    virtual ~NVMeSensor();
+    ~NVMeSensor() override;
 
     NVMeSensor& operator=(const NVMeSensor& other) = delete;
 
diff --git a/include/dbus-sensor_config.h.in b/include/dbus-sensor_config.h.in
index 0e07685..6dc9931 100644
--- a/include/dbus-sensor_config.h.in
+++ b/include/dbus-sensor_config.h.in
@@ -3,7 +3,7 @@
 #include <cstdint>
 
 // clang-format off
-constexpr const bool validateUnsecureFeature = @VALIDATION_UNSECURE_FEATURE@;
+constexpr const int validateUnsecureFeature = @VALIDATION_UNSECURE_FEATURE@;
 
-constexpr const bool insecureSensorOverride = @INSECURE_UNRESTRICTED_SENSOR_OVERRIDE@;
+constexpr const int insecureSensorOverride = @INSECURE_UNRESTRICTED_SENSOR_OVERRIDE@;
 // clang-format on
\ No newline at end of file
diff --git a/include/meson.build b/include/meson.build
index 4810de7..c5b83c3 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -3,4 +3,5 @@
 conf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').enabled())
 configure_file(input: 'dbus-sensor_config.h.in',
                output: 'dbus-sensor_config.h',
-               configuration: conf_data)
\ No newline at end of file
+               configuration: conf_data)
+
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 7021430..25e28fd 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -229,7 +229,7 @@
     {
         if (!internalSet)
         {
-            if (insecureSensorOverride == false)
+            if (insecureSensorOverride == 0)
             { // insecure sesnor override.
                 if (isSensorSettable == false)
                 { // sensor is not settable.
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
index 1c5574b..fd9e543 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
@@ -43,7 +43,9 @@
 
 // clang-format off
 // this needs to be included last or we'll have build issues
+extern "C" {
 #include <linux/peci-ioctl.h>
+}
 #if !defined(PECI_MBX_INDEX_DDR_DIMM_TEMP)
 #define PECI_MBX_INDEX_DDR_DIMM_TEMP MBX_INDEX_DDR_DIMM_TEMP
 #endif
diff --git a/src/NVMeSensor.cpp b/src/NVMeSensor.cpp
index 3af9f69..254ba24 100644
--- a/src/NVMeSensor.cpp
+++ b/src/NVMeSensor.cpp
@@ -29,7 +29,7 @@
                        const std::string& sensorConfiguration,
                        const int busNumber) :
     Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration,
-           NVMeSensor::CONFIG_TYPE, false, false, maxReading, minReading, conn,
+           NVMeSensor::configType, false, false, maxReading, minReading, conn,
            PowerState::on),
     bus(busNumber), objServer(objectServer)
 {
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index 8eaeb57..c2b32f0 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -132,7 +132,7 @@
     for (const auto& [interfacePath, sensorData] : sensorConfigurations)
     {
         // find base configuration
-        auto sensorBase = sensorData.find(NVMeSensor::CONFIG_TYPE);
+        auto sensorBase = sensorData.find(NVMeSensor::configType);
         if (sensorBase != sensorData.end())
         {
             const SensorBaseConfigMap& sensorConfig = sensorBase->second;
@@ -181,7 +181,7 @@
             handleSensorConfigurations(io, objectServer, dbusConnection,
                                        sensorConfigurations);
         }));
-    getter->getConfiguration(std::vector<std::string>{NVMeSensor::CONFIG_TYPE});
+    getter->getConfiguration(std::vector<std::string>{NVMeSensor::configType});
 }
 
 static void interfaceRemoved(sdbusplus::message::message& message,
@@ -257,7 +257,7 @@
         static_cast<sdbusplus::bus::bus&>(*systemBus),
         "type='signal',member='PropertiesChanged',path_namespace='" +
             std::string(inventoryPath) + "',arg0namespace='" +
-            std::string(NVMeSensor::CONFIG_TYPE) + "'",
+            std::string(NVMeSensor::configType) + "'",
         eventHandler);
 
     // Watch for entity-manager to remove configuration interfaces
diff --git a/src/Utils.cpp b/src/Utils.cpp
index c030963..8df9a48 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -610,7 +610,7 @@
     {
         manufacturingMode = true;
     }
-    if (validateUnsecureFeature == true)
+    if (validateUnsecureFeature == 1)
     {
         if (manufacturingModeStatus == "xyz.openbmc_project.Control.Security."
                                        "SpecialMode.Modes.ValidationUnsecure")