clang-tidy: Initial Commit
This commit introduces clang-tidy and modifies code to address
issues flagged by the checks. Additionally, it includes the
initial infrastructure setup.
Tested: Build and unit tests completed successfully.
Change-Id: I55f9f4a2a9a1b1cd2016773b47935484d6a57867
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..00252ca
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,11 @@
+Checks: '
+-*,
+readability-identifier-naming'
+
+WarningsAsErrors: '*'
+HeaderFilterRegex: '.*'
+
+CheckOptions:
+ - { key: readability-identifier-naming.ClassCase, value: CamelCase }
+ - { key: readability-identifier-naming.FunctionCase, value: camelBack }
+ - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
diff --git a/core_manager.hpp b/core_manager.hpp
index 6c7457c..0eed5eb 100644
--- a/core_manager.hpp
+++ b/core_manager.hpp
@@ -36,7 +36,7 @@
{
public:
Manager() = delete;
- Manager(const Manager&) = default;
+ Manager(const Manager&) = delete;
Manager& operator=(const Manager&) = delete;
Manager(Manager&&) = delete;
Manager& operator=(Manager&&) = delete;
diff --git a/dump_manager.hpp b/dump_manager.hpp
index 2dda186..18f6ad8 100644
--- a/dump_manager.hpp
+++ b/dump_manager.hpp
@@ -29,7 +29,7 @@
public:
Manager() = delete;
- Manager(const Manager&) = default;
+ Manager(const Manager&) = delete;
Manager& operator=(const Manager&) = delete;
Manager(Manager&&) = delete;
Manager& operator=(Manager&&) = delete;
diff --git a/dump_manager_bmc.hpp b/dump_manager_bmc.hpp
index f658073..7445c1c 100644
--- a/dump_manager_bmc.hpp
+++ b/dump_manager_bmc.hpp
@@ -37,7 +37,7 @@
{
public:
Manager() = delete;
- Manager(const Manager&) = default;
+ Manager(const Manager&) = delete;
Manager& operator=(const Manager&) = delete;
Manager(Manager&&) = delete;
Manager& operator=(Manager&&) = delete;
diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp
index 6608713..457c4fe 100644
--- a/dump_manager_faultlog.hpp
+++ b/dump_manager_faultlog.hpp
@@ -28,7 +28,7 @@
{
public:
Manager() = delete;
- Manager(const Manager&) = default;
+ Manager(const Manager&) = delete;
Manager& operator=(const Manager&) = delete;
Manager(Manager&&) = delete;
Manager& operator=(Manager&&) = delete;
diff --git a/elog_watch.cpp b/elog_watch.cpp
index 4eb39f2..22cce95 100644
--- a/elog_watch.cpp
+++ b/elog_watch.cpp
@@ -24,7 +24,6 @@
namespace elog
{
-constexpr auto LOG_PATH = "/xyz/openbmc_project/logging";
using Message = std::string;
using Attributes = std::variant<Message>;
using AttributeName = std::string;
diff --git a/elog_watch.hpp b/elog_watch.hpp
index 7b8671f..24dbced 100644
--- a/elog_watch.hpp
+++ b/elog_watch.hpp
@@ -35,8 +35,8 @@
~Watch() = default;
Watch(const Watch&) = delete;
Watch& operator=(const Watch&) = delete;
- Watch(Watch&&) = default;
- Watch& operator=(Watch&&) = default;
+ Watch(Watch&&) = delete;
+ Watch& operator=(Watch&&) = delete;
/** @brief constructs watch for elog add and delete signals.
* @param[in] bus - The Dbus bus object
@@ -56,6 +56,7 @@
template <class Archive>
void serialize(Archive& a, const std::uint32_t version)
{
+ (void)version; // Mark version as unused to avoid warning
a(elogList);
// TODO: openbmc/phosphor-debug-collector#1
diff --git a/watch.hpp b/watch.hpp
index a9ec18e..96ec891 100644
--- a/watch.hpp
+++ b/watch.hpp
@@ -48,8 +48,8 @@
Watch(const Watch&) = delete;
Watch& operator=(const Watch&) = delete;
- Watch(Watch&&) = default;
- Watch& operator=(Watch&&) = default;
+ Watch(Watch&&) = delete;
+ Watch& operator=(Watch&&) = delete;
/* @brief dtor - remove inotify watch and close fd's */
~Watch();