Add back include cleaner
Include cleaner helps the code review process. Add it back, by ignoring
some of the more recent boost headers.
Change-Id: I6eddd0e67cd9f469c93fbb344cc1ab46231e450f
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/.clang-tidy b/.clang-tidy
index 0c672f0..6f5f71d 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -240,6 +240,7 @@
misc-coroutine-hostile-raii,
misc-definitions-in-headers,
misc-header-include-cycle,
+ misc-include-cleaner,
misc-misleading-bidirectional,
misc-misleading-identifier,
misc-misplaced-const,
@@ -351,7 +352,7 @@
- key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams
value: true
- key: misc-include-cleaner.IgnoreHeaders
- value: ((nlohmann/json.hpp)|(nlohmann/json_fwd.hpp)|(boost/asio/connect_pipe.hpp)|(boost/beast/websocket/rfc6455.hpp)|(read.hpp)|(write.hpp)|(boost/circular_buffer.hpp)|(boost/asio/.*read.hpp)|(boost/.*/src.hpp)|(boost/.*/detail/.*)|(nlohmann/detail/.*)|(stdio.h)|(ranges)|(bits/.*)|(boost/system/error_code.hpp)|(json_formatters.hpp)|(boost_formatters.hpp)|(CLI/.*))
+ value: ((nlohmann/json.hpp)|(nlohmann/json_fwd.hpp)|(boost/beast/http/.*_fwd.hpp)|(boost/beast/http/serializer.hpp)|(boost/asio/connect_pipe.hpp)|(boost/beast/websocket/rfc6455.hpp)|(read.hpp)|(write.hpp)|(boost/circular_buffer.hpp)|(boost/asio/.*read.hpp)|(boost/.*/src.hpp)|(boost/.*/detail/.*)|(nlohmann/detail/.*)|(stdio.h)|(ranges)|(bits/.*)|(boost/system/error_code.hpp)|(json_formatters.hpp)|(boost_formatters.hpp)|(CLI/.*))
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 8d30472..040bd40 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -23,15 +23,17 @@
#include <array>
#include <cstddef>
-#include <cstdint>
#include <source_location>
#include <span>
-#include <string>
#include <string_view>
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/redfish-core/src/heartbeat_messages.cpp b/redfish-core/src/heartbeat_messages.cpp
index 28991dc..1d7a033 100644
--- a/redfish-core/src/heartbeat_messages.cpp
+++ b/redfish-core/src/heartbeat_messages.cpp
@@ -23,6 +23,10 @@
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/redfish-core/src/resource_messages.cpp b/redfish-core/src/resource_messages.cpp
index 17ef0c4..74d8bd0 100644
--- a/redfish-core/src/resource_messages.cpp
+++ b/redfish-core/src/resource_messages.cpp
@@ -23,6 +23,10 @@
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/redfish-core/src/subscription.cpp b/redfish-core/src/subscription.cpp
index 69836a8..5d6d629 100644
--- a/redfish-core/src/subscription.cpp
+++ b/redfish-core/src/subscription.cpp
@@ -22,7 +22,6 @@
#include <boost/asio/io_context.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/beast/http/field.hpp>
-#include <boost/beast/http/fields.hpp>
#include <boost/beast/http/verb.hpp>
#include <boost/system/errc.hpp>
#include <boost/url/format.hpp>
diff --git a/redfish-core/src/task_messages.cpp b/redfish-core/src/task_messages.cpp
index 79c312a..867e735 100644
--- a/redfish-core/src/task_messages.cpp
+++ b/redfish-core/src/task_messages.cpp
@@ -17,14 +17,16 @@
#include <array>
#include <cstddef>
-#include <cstdint>
#include <span>
-#include <string>
#include <string_view>
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/redfish-core/src/update_messages.cpp b/redfish-core/src/update_messages.cpp
index a11cd6a..afaf0ac 100644
--- a/redfish-core/src/update_messages.cpp
+++ b/redfish-core/src/update_messages.cpp
@@ -17,14 +17,16 @@
#include <array>
#include <cstddef>
-#include <cstdint>
#include <span>
-#include <string>
#include <string_view>
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 8ee9fc9..3c38764 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -532,10 +532,6 @@
headers.append("<array>")
headers.append("<cstddef>")
headers.append("<span>")
-
- if registry_name not in ("ResourceEvent", "HeartbeatEvent"):
- headers.append("<cstdint>")
- headers.append("<string>")
headers.append("<string_view>")
for header in headers:
@@ -546,6 +542,10 @@
// Clang can't seem to decide whether this header needs to be included or not,
// and is inconsistent. Include it for now
// NOLINTNEXTLINE(misc-include-cleaner)
+#include <cstdint>
+// NOLINTNEXTLINE(misc-include-cleaner)
+#include <string>
+// NOLINTNEXTLINE(misc-include-cleaner)
#include <utility>
namespace redfish
diff --git a/src/dbus_utility.cpp b/src/dbus_utility.cpp
index 76ce82d..236faa5 100644
--- a/src/dbus_utility.cpp
+++ b/src/dbus_utility.cpp
@@ -14,7 +14,6 @@
#include <array>
#include <cstdint>
-#include <filesystem>
#include <functional>
#include <regex>
#include <span>
diff --git a/test/http/http_response_test.cpp b/test/http/http_response_test.cpp
index 62a95a4..536415e 100644
--- a/test/http/http_response_test.cpp
+++ b/test/http/http_response_test.cpp
@@ -8,7 +8,6 @@
#include <boost/beast/core/buffers_to_string.hpp>
#include <boost/beast/core/file_base.hpp>
#include <boost/beast/core/file_posix.hpp>
-#include <boost/beast/http/message.hpp>
#include <boost/beast/http/serializer.hpp>
#include <boost/beast/http/status.hpp>
diff --git a/test/redfish-core/include/utils/json_utils_test.cpp b/test/redfish-core/include/utils/json_utils_test.cpp
index c578be9..efaed6d 100644
--- a/test/redfish-core/include/utils/json_utils_test.cpp
+++ b/test/redfish-core/include/utils/json_utils_test.cpp
@@ -10,6 +10,7 @@
#include <cstddef>
#include <cstdint>
+#include <functional>
#include <optional>
#include <string>
#include <system_error>
diff --git a/test/redfish-core/include/utils/systems_utils_test.cpp b/test/redfish-core/include/utils/systems_utils_test.cpp
index b2fceba..df16f1c 100644
--- a/test/redfish-core/include/utils/systems_utils_test.cpp
+++ b/test/redfish-core/include/utils/systems_utils_test.cpp
@@ -1,14 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors
+#include "async_resp.hpp"
#include "dbus_utility.hpp"
#include "utils/systems_utils.hpp"
-#include <boost/beast/http/status.hpp>
-#include <boost/system/errc.hpp>
#include <nlohmann/json.hpp>
-#include <sdbusplus/message.hpp>
+#include <memory>
#include <string>
#include <gtest/gtest.h>