Enable cpp core guidelines macro checks
We only use a couple macros. Ignore them in the checks.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I38feb10f76f6aaea8899617f081c9be68c88b3eb
diff --git a/http/app.hpp b/http/app.hpp
index 8dcec48..03de3f8 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -16,6 +16,7 @@
#include <string>
#include <utility>
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_ROUTE(app, url) \
app.template route<crow::black_magic::getParameterTag(url)>(url)
diff --git a/http/logging.hpp b/http/logging.hpp
index e2bfdb1..ca6bdc6 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -105,18 +105,31 @@
};
} // namespace crow
+// The logging functions currently use macros. Now that we have c++20, ideally
+// they'd use source_location with fixed functions, but for the moment, disable
+// the check.
+
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_CRITICAL \
if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Critical) \
crow::Logger("CRITICAL", __FILE__, __LINE__, crow::LogLevel::Critical)
+
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_ERROR \
if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Error) \
crow::Logger("ERROR", __FILE__, __LINE__, crow::LogLevel::Error)
+
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_WARNING \
if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Warning) \
crow::Logger("WARNING", __FILE__, __LINE__, crow::LogLevel::Warning)
+
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_INFO \
if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Info) \
crow::Logger("INFO", __FILE__, __LINE__, crow::LogLevel::Info)
+
+// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BMCWEB_LOG_DEBUG \
if (crow::Logger::getCurrentLogLevel() <= crow::LogLevel::Debug) \
crow::Logger("DEBUG", __FILE__, __LINE__, crow::LogLevel::Debug)