diff --git a/.clang-tidy b/.clang-tidy index 6c7a70806..91ad20646 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -58,7 +58,8 @@ Checks: '*, -readability-implicit-bool-conversion, -readability-magic-numbers, -readability-named-parameter, - -misc-no-recursion' + -misc-no-recursion, + -concurrency-mt-unsafe' WarningsAsErrors: '' HeaderFilterRegex: 'src/.*' AnalyzeTemporaryDtors: false diff --git a/src/query/procedure/module.cpp b/src/query/procedure/module.cpp index 93ad04878..c0f853fc0 100644 --- a/src/query/procedure/module.cpp +++ b/src/query/procedure/module.cpp @@ -325,15 +325,16 @@ bool SharedLibraryModule::Load(const std::filesystem::path &file_path) { dlerror(); // Clear any existing error. handle_ = dlopen(file_path.c_str(), RTLD_NOW | RTLD_LOCAL); if (!handle_) { - // NOLINTNEXTLINE(concurrency-mt-unsafe) - spdlog::error(utils::MessageWithLink("Unable to load module {}; {}.", file_path, dlerror(), "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Unable to load module {}; {}.", file_path, dlerror(), "https://memgr.ph/modules")); return false; } // Get required mgp_init_module init_fn_ = reinterpret_cast(dlsym(handle_, "mgp_init_module")); char *dl_errored = dlerror(); if (!init_fn_ || dl_errored) { - spdlog::error(utils::MessageWithLink("Unable to load module {}; {}.", file_path, dl_errored, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Unable to load module {}; {}.", file_path, dl_errored, "https://memgr.ph/modules")); dlclose(handle_); handle_ = nullptr; return false; @@ -384,8 +385,8 @@ bool SharedLibraryModule::Close() { spdlog::warn("When closing module {}; mgp_shutdown_module returned {}", file_path_, shutdown_res); } if (dlclose(handle_) != 0) { - // NOLINTNEXTLINE(concurrency-mt-unsafe) - spdlog::error(utils::MessageWithLink("Failed to close module {}; {}.", file_path_, dlerror(), "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Failed to close module {}; {}.", file_path_, dlerror(), "https://memgr.ph/modules")); return false; } spdlog::info("Closed module {}", file_path_); @@ -444,7 +445,8 @@ bool PythonModule::Load(const std::filesystem::path &file_path) { auto gil = py::EnsureGIL(); auto maybe_exc = py::AppendToSysPath(file_path.parent_path().c_str()); if (maybe_exc) { - spdlog::error(utils::MessageWithLink("Unable to load module {}; {}.", file_path, *maybe_exc, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Unable to load module {}; {}.", file_path, *maybe_exc, "https://memgr.ph/modules")); return false; } bool succ = true; @@ -469,7 +471,8 @@ bool PythonModule::Load(const std::filesystem::path &file_path) { return true; } auto exc_info = py::FetchError().value(); - spdlog::error(utils::MessageWithLink("Unable to load module {}; {}.", file_path, exc_info, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Unable to load module {}; {}.", file_path, exc_info, "https://memgr.ph/modules")); return false; } @@ -534,7 +537,8 @@ bool ModuleRegistry::RegisterModule(const std::string_view &name, std::unique_pt MG_ASSERT(!name.empty(), "Module name cannot be empty"); MG_ASSERT(module, "Tried to register an invalid module"); if (modules_.find(name) != modules_.end()) { - spdlog::error(utils::MessageWithLink("Unable to overwrite an already loaded module {}.", name, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Unable to overwrite an already loaded module {}.", name, "https://memgr.ph/modules")); return false; } modules_.emplace(name, std::move(module)); @@ -564,7 +568,8 @@ void ModuleRegistry::SetModulesDirectory(std::vector modu bool ModuleRegistry::LoadModuleIfFound(const std::filesystem::path &modules_dir, const std::string_view name) { if (!utils::DirExists(modules_dir)) { - spdlog::error(utils::MessageWithLink("Module directory {} doesn't exist.", modules_dir, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Module directory {} doesn't exist.", modules_dir, "https://memgr.ph/modules")); return false; } for (const auto &entry : std::filesystem::directory_iterator(modules_dir)) { @@ -601,7 +606,8 @@ bool ModuleRegistry::LoadOrReloadModuleFromName(const std::string_view name) { void ModuleRegistry::LoadModulesFromDirectory(const std::filesystem::path &modules_dir) { if (modules_dir.empty()) return; if (!utils::DirExists(modules_dir)) { - spdlog::error(utils::MessageWithLink("Module directory {} doesn't exist.", modules_dir, "https://memgr.ph/modules")); + spdlog::error( + utils::MessageWithLink("Module directory {} doesn't exist.", modules_dir, "https://memgr.ph/modules")); return; } for (const auto &entry : std::filesystem::directory_iterator(modules_dir)) { diff --git a/src/utils/license.cpp b/src/utils/license.cpp index 261b9e3a5..7ee02d9b2 100644 --- a/src/utils/license.cpp +++ b/src/utils/license.cpp @@ -175,13 +175,11 @@ void LicenseChecker::EnableTesting() { } void LicenseChecker::CheckEnvLicense() { - // NOLINTNEXTLINE(concurrency-mt-unsafe) const char *license_key = std::getenv("MEMGRAPH_ENTERPRISE_LICENSE"); if (!license_key) { return; } - // NOLINTNEXTLINE(concurrency-mt-unsafe) const char *organization_name = std::getenv("MEMGRAPH_ORGANIZATION_NAME"); if (!organization_name) { return;