From ec85f2eb043c4edcadd3b58ecc8de2f28a2f2d3d Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Thu, 18 Dec 2025 22:38:14 +0530 Subject: [PATCH 1/7] clang.tiddy: add cppcoreguidelines-interfaces-global-init --- .clang-tidy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 1c483387e8..b4c06720e1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -6,7 +6,8 @@ Checks: > cppcoreguidelines-avoid-capturing-lambda-coroutines, cppcoreguidelines-avoid-goto, cppcoreguidelines-avoid-non-const-global-variables, - cppcoreguidelines-avoid-reference-coroutine-parameters + cppcoreguidelines-avoid-reference-coroutine-parameters, + cppcoreguidelines-interfaces-global-init WarningsAsErrors: '' HeaderFilterRegex: './include' From ebc9116bbbd278dc78f3626dea478602de1c23e0 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Fri, 19 Dec 2025 01:21:15 +0530 Subject: [PATCH 2/7] clang-tidy: add cppcoreguidelines-rvalue-reference-param-not-moved --- .clang-tidy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index b4c06720e1..989d47bfea 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,7 +7,8 @@ Checks: > cppcoreguidelines-avoid-goto, cppcoreguidelines-avoid-non-const-global-variables, cppcoreguidelines-avoid-reference-coroutine-parameters, - cppcoreguidelines-interfaces-global-init + cppcoreguidelines-interfaces-global-init, + cppcoreguidelines-rvalue-reference-param-not-moved WarningsAsErrors: '' HeaderFilterRegex: './include' From 1ab8e26da7653d629dbfcd254d6558f9f1acc129 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Fri, 19 Dec 2025 01:33:50 +0530 Subject: [PATCH 3/7] clang-tidy: add cppcoreguidelines-pro-type-member-init & fixed minCostMaxFlow.cpp --- .clang-tidy | 3 ++- src/max_flow/minCostMaxFlow.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 989d47bfea..2fa254246c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,7 +8,8 @@ Checks: > cppcoreguidelines-avoid-non-const-global-variables, cppcoreguidelines-avoid-reference-coroutine-parameters, cppcoreguidelines-interfaces-global-init, - cppcoreguidelines-rvalue-reference-param-not-moved + cppcoreguidelines-rvalue-reference-param-not-moved, + cppcoreguidelines-pro-type-member-init WarningsAsErrors: '' HeaderFilterRegex: './include' diff --git a/src/max_flow/minCostMaxFlow.cpp b/src/max_flow/minCostMaxFlow.cpp index e33184a036..d0165dfcc2 100644 --- a/src/max_flow/minCostMaxFlow.cpp +++ b/src/max_flow/minCostMaxFlow.cpp @@ -145,7 +145,7 @@ PgrCostFlowGraph::GetFlowEdges() const { if (((capacity[*e] - residual_capacity[*e]) > 0) && ((*e).m_source != supersource) && ((*e).m_target != supersink)) { - Flow_t edge; + Flow_t edge{}; edge.edge = GetEdgeId(*e); edge.source = GetVertexId((*e).m_source); edge.target = GetVertexId((*e).m_target); From bf2cca1d7250c36ee8d64d733a3a92ea1a474e56 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Fri, 26 Dec 2025 23:19:56 +0530 Subject: [PATCH 4/7] fix warnings in path.hpp --- include/cpp_common/path.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cpp_common/path.hpp b/include/cpp_common/path.hpp index 5f0875b3b3..9f8d7ac418 100644 --- a/include/cpp_common/path.hpp +++ b/include/cpp_common/path.hpp @@ -59,10 +59,10 @@ class Path { std::deque< Path_t > path; int64_t m_start_id; int64_t m_end_id; - double m_tot_cost; + double m_tot_cost{0}; public: - Path(): m_start_id(0), m_end_id(0), m_tot_cost(0) + Path() : m_start_id(0), m_end_id(0), m_tot_cost(0) {} Path(int64_t s_id, int64_t e_id) : m_start_id(s_id), m_end_id(e_id), m_tot_cost(0) From 632973f548d282dcf416d31ee9e5516183b937f9 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Sat, 27 Dec 2025 00:03:33 +0530 Subject: [PATCH 5/7] remove redundant initialization in include/common/path.hpp --- include/cpp_common/path.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/cpp_common/path.hpp b/include/cpp_common/path.hpp index 9f8d7ac418..d0b9c5fb12 100644 --- a/include/cpp_common/path.hpp +++ b/include/cpp_common/path.hpp @@ -62,10 +62,10 @@ class Path { double m_tot_cost{0}; public: - Path() : m_start_id(0), m_end_id(0), m_tot_cost(0) + Path() : m_start_id(0), m_end_id(0) {} Path(int64_t s_id, int64_t e_id) - : m_start_id(s_id), m_end_id(e_id), m_tot_cost(0) + : m_start_id(s_id), m_end_id(e_id) {} int64_t start_id() const {return m_start_id;} @@ -189,8 +189,7 @@ class Path { const Path &original, bool only_cost) : m_start_id(original.m_start_id), - m_end_id(original.m_end_id), - m_tot_cost(0) { + m_end_id(original.m_end_id) { if (original.path.empty()) return; typename G::EO_i ei, ei_end; From 648184d9b9b935bfcda631aa22d641c48be1ea70 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Sat, 27 Dec 2025 23:51:33 +0530 Subject: [PATCH 6/7] remove cppcoreguidelines-pro-type-member-init from .clang-tidy --- .clang-tidy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2fa254246c..989d47bfea 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,8 +8,7 @@ Checks: > cppcoreguidelines-avoid-non-const-global-variables, cppcoreguidelines-avoid-reference-coroutine-parameters, cppcoreguidelines-interfaces-global-init, - cppcoreguidelines-rvalue-reference-param-not-moved, - cppcoreguidelines-pro-type-member-init + cppcoreguidelines-rvalue-reference-param-not-moved WarningsAsErrors: '' HeaderFilterRegex: './include' From dd67e4f0f92f0f528c2aba46232709e406ebf304 Mon Sep 17 00:00:00 2001 From: Abhivansh <31abhivanshj@gmail.com> Date: Mon, 5 Jan 2026 22:00:53 +0530 Subject: [PATCH 7/7] remove the trailing comma from the concerned line --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 989d47bfea..03c5e512af 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,7 +7,7 @@ Checks: > cppcoreguidelines-avoid-goto, cppcoreguidelines-avoid-non-const-global-variables, cppcoreguidelines-avoid-reference-coroutine-parameters, - cppcoreguidelines-interfaces-global-init, + cppcoreguidelines-interfaces-global-init cppcoreguidelines-rvalue-reference-param-not-moved WarningsAsErrors: ''