From cf9e417d3b88eb12f8c6a9d007d6a63c3eeb94f4 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 21 Dec 2022 09:30:16 -0800 Subject: Add check for globals We don't follow this cpp core guidelines rule well. This is something that we should aspire to cleaning up in the future, but for the moment, lets turn the rule on in clang-tidy to stop the bleeding, add ignores for the things that we know need some better abstractions, and work on these over time. Most of this commit is just adding NOLINTNEXTLINE exceptions for all of our globals. There was one case in the sensor code where clang correctly noted that those globals weren't actually const, which got missed because of the use of auto. Tested: CI should be good enough for this. Passes clang-tidy. Signed-off-by: Ed Tanous Change-Id: Ieda08fee69a3b209d4b3e9771809a6c41524f066 --- src/dbus_singleton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dbus_singleton.cpp b/src/dbus_singleton.cpp index f78164fbe2..726c3d4bb5 100644 --- a/src/dbus_singleton.cpp +++ b/src/dbus_singleton.cpp @@ -6,7 +6,7 @@ namespace crow { namespace connections { - +// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) sdbusplus::asio::connection* systemBus = nullptr; } // namespace connections -- cgit v1.2.3