Skip to content

Conversation

@mayurgalhate
Copy link
Contributor

@mayurgalhate mayurgalhate commented Jan 1, 2026

This PR adds the cppcoreguidelines-special-member-functions check to the .clang-tidy configuration.

Purpose of this check

  • Ensures special member functions (copy/move constructors, assignment operators, destructor) are explicitly declared
  • Prevents unintended implicit copy or move operations
  • Makes object lifetime and ownership semantics explicit
  • Follows C++ Core Guidelines best practices

Changes made:

  • Modified .clang-tidy to include the cppcoreguidelines-special-member-functions check
  • Updated affected classes to explicitly default or delete special member functions

Summary by CodeRabbit

  • Chores

    • Clarified copy/move semantics and defaulted/destructor declarations across several core types to standardize object lifecycle and ownership.
    • Enabled additional static-analysis checks to reinforce member-initialization and special-member-function guidance.
  • Documentation

    • Updated translation/PO metadata and contributor attributions for release notes, including timestamp and contributor list adjustments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 1, 2026

Walkthrough

Adjusts special-member-function declarations across several headers: defaulting or deleting copy/move constructors and assignment operators, and defaulting destructors for exception, vertex, message, fleet, and problem classes; also updates .clang-tidy to enable cppcoreguidelines-special-member-functions.

Changes

Cohort / File(s) Summary
Exception class
include/cpp_common/assert.hpp
AssertFailedException: added public copy and move constructors (= default); deleted copy and move assignment operators; destructor changed to = default.
Vertex / container-like
include/cpp_common/basic_vertex.hpp
Basic_vertex: added move constructor and move assignment (= default); defaulted destructor.
Message class
include/cpp_common/messages.hpp
Pgr_messages: explicit defaulted destructor added; move constructor and move assignment deleted.
Fleet class
include/vrp/fleet.hpp
Fleet: defaulted destructor added; move constructor and move assignment deleted.
Problem class
include/vrp/pd_problem.hpp
PD_problem: removed deleted copy-constructor (copy ctor now available); copy assignment deleted; defaulted destructor added; move constructor and move assignment deleted (default ctor remains deleted).
Static analysis config
.clang-tidy
Enabled cppcoreguidelines-special-member-functions in Checks alongside cppcoreguidelines-prefer-member-initializer; CheckOptions adjusted.
Localization
locale/**/pgrouting_doc_strings.*
Updated POT header timestamps and contributor lists (credit/author text changes only).

Sequence Diagram(s)

(omitted — changes are API/member-signature adjustments without multi-component runtime control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cvvergara

Poem

🐇 I hopped through headers, tidy and neat,
I set defaults and deletions, quick and fleet.
Copy and move each found their place,
Destructors settled with gentle grace.
A tiny rabbit cheers this tidy space!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.75% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the primary change—enabling the cppcoreguidelines-special-member-functions check in clang-tidy configuration.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bf1179 and 8ac61c3.

📒 Files selected for processing (3)
  • .clang-tidy
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
  • locale/pot/pgrouting_doc_strings.pot
🧰 Additional context used
🧠 Learnings (18)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-31T06:01:45.144Z
Learnt from: Mohit242-bit
Repo: pgRouting/pgrouting PR: 3018
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:11-11
Timestamp: 2025-12-31T06:01:45.144Z
Learning: In pgRouting/pgrouting, CI/Weblate may update locale/pot/pgrouting_doc_strings.pot and locale/en/LC_MESSAGES/pgrouting_doc_strings.po in PRs after .rst changes. These auto-generated updates are acceptable and should not be flagged; only manual edits to .po files should be discouraged.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-02-27T16:32:00.573Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2764
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:0-0
Timestamp: 2025-02-27T16:32:00.573Z
Learning: Modifications to locale files in the pgRouting project should be handled through an action commit or through the Weblate translation platform, not via direct edits.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-02-27T16:31:49.972Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2764
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:2740-2740
Timestamp: 2025-02-27T16:31:49.972Z
Learning: Modifications to locale files in pgRouting (like .po files) are done through action commits or in weblate, not through direct manual edits in PRs.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-02-27T23:03:08.160Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2771
File: locale/en/LC_MESSAGES/pgrouting_doc_strings.po:4407-4419
Timestamp: 2025-02-27T23:03:08.160Z
Learning: In the pgRouting project, locale files (.po files) should not be manually edited as they are managed through automated localization tools.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-10-30T16:43:11.554Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2989
File: locale/es/LC_MESSAGES/pgrouting_doc_strings.po:10-10
Timestamp: 2025-10-30T16:43:11.554Z
Learning: When a locale translation change (e.g., locale/es/LC_MESSAGES/pgrouting_doc_strings.po) is introduced by a Weblate-authored commit within a PR, it is compliant with pgRouting’s workflow and should not be flagged; only manual edits to .po files should be discouraged.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-24T23:36:04.580Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2868
File: include/drivers/contraction/contractionHierarchies_driver.h:1-73
Timestamp: 2025-04-24T23:36:04.580Z
Learning: The copyright year for pgRouting should be set to 2025 in new files, not 2024, as confirmed by the project maintainer.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
📚 Learning: 2025-04-22T22:41:25.296Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: NEWS.md:56-57
Timestamp: 2025-04-22T22:41:25.296Z
Learning: In pgRouting, NEWS.md is an automatically generated file that should not be modified manually. Changes to the NEWS.md content should be made by modifying the generator script (tools/release-scripts/notes2news.pl) or its source files.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-24T23:34:23.099Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2868
File: NEWS.md:46-47
Timestamp: 2025-04-24T23:34:23.099Z
Learning: For pgRouting, NEWS.md should be updated using the generator script (tools/release-scripts/notes2news.pl) rather than edited directly, which is the correct procedure that the project maintainers follow.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-22T22:59:10.377Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: locale/es/LC_MESSAGES/pgrouting_doc_strings.po:15446-15454
Timestamp: 2025-04-22T22:59:10.377Z
Learning: En pgRouting, las traducciones al español de las cadenas de documentación (por ejemplo, en `pgrouting_doc_strings.po`) se gestionan a través de Weblate y no se deben sugerir ni modificar directamente en los pull requests.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-22T22:36:50.711Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: locale/zh_Hans/LC_MESSAGES/pgrouting_doc_strings.po:4083-4087
Timestamp: 2025-04-22T22:36:50.711Z
Learning: For the `locale/zh_Hans/LC_MESSAGES/pgrouting_doc_strings.po` file, Chinese translations should be managed and updated via Weblate, not by direct manual edits or suggestions in the repository.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-22T22:58:08.854Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: locale/es/LC_MESSAGES/pgrouting_doc_strings.po:16304-16305
Timestamp: 2025-04-22T22:58:08.854Z
Learning: En el repositorio pgRouting, las traducciones al español se gestionan exclusivamente a través de Weblate, por lo que no se deben sugerir cambios manuales en los archivos .po para ese idioma en las revisiones de PR.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-09-14T23:32:11.977Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2970
File: doc/CMakeLists.txt:160-161
Timestamp: 2025-09-14T23:32:11.977Z
Learning: The pgRouting project uses Weblate for translation management. The CMake locale target only generates English locale files (`-l en`) because Weblate handles updating all other language translations automatically. This prevents conflicts between local builds and Weblate's translation workflow.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-22T22:58:42.373Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: locale/es/LC_MESSAGES/pgrouting_doc_strings.po:4429-4443
Timestamp: 2025-04-22T22:58:42.373Z
Learning: En el proyecto pgRouting, las traducciones al español se gestionan exclusivamente a través de Weblate, por lo que no se deben sugerir cambios de traducción en los pull requests.

Applied to files:

  • locale/pot/pgrouting_doc_strings.pot
  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-04-22T22:41:34.709Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2864
File: NEWS.md:47-50
Timestamp: 2025-04-22T22:41:34.709Z
Learning: In pgRouting, NEWS.md is a generated file created by the tools/release-scripts/notes2news.pl script and should not be modified manually.

Applied to files:

  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-09-15T00:39:05.272Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2970
File: NEWS.md:16-24
Timestamp: 2025-09-15T00:39:05.272Z
Learning: In pgRouting, editorial improvements to NEWS.md content should be implemented via the notes2news.pl script or its source files, since NEWS.md is auto-generated and manual edits would be overwritten.

Applied to files:

  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
📚 Learning: 2025-05-22T21:14:00.661Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2898
File: NEWS.md:99-99
Timestamp: 2025-05-22T21:14:00.661Z
Learning: In pgRouting, the NEWS.md file is automatically generated and should not be manually edited, as changes would be overwritten during the next generation.

Applied to files:

  • locale/en/LC_MESSAGES/pgrouting_doc_strings.po
🔇 Additional comments (6)
.clang-tidy (1)

11-12: Undocumented check addition: cppcoreguidelines-prefer-member-initializer not mentioned in PR objectives.

The PR title, description, and commit messages state this PR adds only cppcoreguidelines-special-member-functions, but line 11 also adds cppcoreguidelines-prefer-member-initializer without explanation. Either remove the undocumented check to match the PR scope, or update the PR description to document why both checks are being added.

Was the addition of cppcoreguidelines-prefer-member-initializer intentional? If so, please update the PR description to document this change.

locale/pot/pgrouting_doc_strings.pot (3)

11-11: POT creation date bump looks correct

The updated POT-Creation-Date reflects regeneration of the catalog and is consistent with normal locale tooling; no action needed.
Based on learnings, this kind of auto-generated locale metadata change is acceptable.


7147-7151: Updated v4.0.0 release contributor line is consistent

Switching the v4.0.0 “Individuals in this release” line to “Mohit Rawat, Regina Obe, Vicky Vergara” maintains alphabetical order and matches the intended crediting; nothing to change here.
Based on learnings, treating this as a doc-driven locale update is fine.


7201-7205: Contributor list extension keeps alphabetical ordering

Adding “Mohit Rawat” to the long “Individuals (in alphabetical order)” list preserves the first-name alphabetical ordering and appropriately keeps existing contributors; this looks good.
Based on learnings, this auto-updated .pot content should be accepted as-is.

locale/en/LC_MESSAGES/pgrouting_doc_strings.po (2)

11-11: POT-Creation-Date metadata update is fine

The updated POT-Creation-Date matches a regenerated documentation catalog; no functional or workflow impact.

Based on learnings, this kind of .po metadata change is expected from the locale generation pipeline and doesn’t need manual adjustment.


8329-8330: Credits/contributors text changes look consistent and ordered

The updated “Individuals in this release v4.0.0” line and the long contributors list keep names in alphabetical order and simply add “Mohit Rawat” as expected for updated release credits; no issues from a localization or tooling perspective.

Based on learnings, these msgid changes are presumed to come from updated .rst/.pot sources and are appropriate to keep in the .po file.

Also applies to: 8397-8401


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d76cc6 and b0b4670.

📒 Files selected for processing (1)
  • include/vrp/solution.hpp
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In pgRouting's .clang-tidy file (and similar list configurations), the last line of lists should not have a trailing comma, per project convention.
🧬 Code graph analysis (1)
include/vrp/solution.hpp (1)
src/pickDeliver/solution.cpp (1)
  • Solution (232-240)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
include/vrp/solution.hpp (1)

67-69: The defaulted copy operations will copy EPSILON from the source object rather than resetting it to 0.0001, but this behavioral change has no practical impact. EPSILON is never read, compared, or used in any logic within the codebase—it only appears in the member declaration and constructor initialization. Since the member is unused, whether it's copied or reset is inconsequential.

Likely an incorrect or invalid review comment.

@mayurgalhate mayurgalhate force-pushed the clang-tidy-special-member-functions branch from b0b4670 to f3553dc Compare January 1, 2026 21:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
include/cpp_common/line_vertex.hpp (1)

58-75: Consider simplifying: all members are trivially copyable.

Since all members (int64_t, double) are trivially copyable, both copy operations could be defaulted:

🔎 Simplified implementation
-     Line_vertex(const Line_vertex &v) :
-         id(v.id),
-         vertex_id(v.vertex_id),
-         source(v.source),
-         target(v.target),
-         cost(v.cost) {}
- Line_vertex& operator=(const Line_vertex &v) {
-        cp_members(v);
-        return *this;
-    }
+     Line_vertex(const Line_vertex&) = default;
+     Line_vertex& operator=(const Line_vertex&) = default;

This also allows removing the cp_members(const Line_vertex&) overload if it's not used elsewhere.

♻️ Duplicate comments (1)
include/vrp/solution.hpp (1)

64-72: Add noexcept to move operations as previously noted.

The past review correctly identified that move operations should be noexcept for optimal container performance. All member types (double, std::deque, Fleet) support noexcept moves.

🔎 Proposed fix
-    Solution(Solution&&) = default;
-    Solution& operator=(Solution&&) = default;
+    Solution(Solution&&) noexcept = default;
+    Solution& operator=(Solution&&) noexcept = default;
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0b4670 and f3553dc.

📒 Files selected for processing (14)
  • include/bdAstar/bdAstar.hpp
  • include/bdDijkstra/bdDijkstra.hpp
  • include/chinese/chinesePostman.hpp
  • include/cpp_common/assert.hpp
  • include/cpp_common/basic_vertex.hpp
  • include/cpp_common/bidirectional.hpp
  • include/cpp_common/line_vertex.hpp
  • include/cpp_common/messages.hpp
  • include/trsp/trspHandler.hpp
  • include/vrp/fleet.hpp
  • include/vrp/pd_problem.hpp
  • include/vrp/solution.hpp
  • include/withPoints/withPoints.hpp
  • include/yen/ksp.hpp
🧰 Additional context used
🧬 Code graph analysis (3)
include/vrp/solution.hpp (1)
src/pickDeliver/solution.cpp (1)
  • Solution (232-240)
include/vrp/fleet.hpp (1)
src/pickDeliver/fleet.cpp (2)
  • Fleet (50-54)
  • Fleet (56-63)
include/vrp/pd_problem.hpp (1)
src/pickDeliver/pd_problem.cpp (1)
  • PD_problem (40-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (9)
include/cpp_common/basic_vertex.hpp (1)

56-58: LGTM! Completes the Rule of Five appropriately.

The defaulted move operations and destructor complete the special member function set for this simple class. Since Basic_vertex contains only a trivial int64_t member, all defaulted operations are safe and efficient.

include/trsp/trspHandler.hpp (1)

118-122: LGTM! Explicit non-copyable/non-movable semantics.

While the base class Pgr_messages (line 54) already prevents copy and move operations, explicitly deleting them in the derived class makes the intent clear and serves as better API documentation.

include/bdAstar/bdAstar.hpp (1)

83-86: Verify that the base class Pgr_bidirectional<G> supports copy and move operations.

Similar to Pgr_bdDijkstra, this class defaults copy and move operations while inheriting from Pgr_bidirectional<G> (line 47). The additional members m_heuristic and m_factor (lines 192-193) are trivially copyable, but the base class's copyability still needs verification.

Ensure the base class safely supports copy/move operations before relying on defaulted behavior.

The verification script from the bdDijkstra.hpp review applies equally here, as both classes share the same base class.

include/cpp_common/messages.hpp (1)

43-47: Remove this comment — the move operation deletion is intentional design.

Pgr_messages is designed as a reference-only class. All usage patterns in the codebase return references (Pgr_messages&), never values. The deletion of both copy and move operations enforces this reference-based API and prevents accidental value semantics. This is consistent with the class's role as a shared message accumulator accessed through static or instance methods. No code attempts to move instances or store them in containers, confirming the design intent is correct.

Likely an incorrect or invalid review comment.

include/bdDijkstra/bdDijkstra.hpp (1)

82-85: The base class Pgr_bidirectional<G> explicitly defaults copy and move operations, making the derived class defaults safe.

The base class (bidirectional.hpp lines 83-86) provides matching default copy/move operations. The mutable algorithm state members (priority queues and vectors) employ proper C++ deep-copy semantics via std::vector's copy constructor, so each copy maintains independent state rather than sharing. The reference member G &graph is correctly copied as a reference.

In practice, the object is instantiated once in the driver code and reused across iterations using clear() to reset state. Copy/move operations are never invoked. Consider whether these defaults should be explicitly deleted to prevent accidental copies and clarify intent.

include/withPoints/withPoints.hpp (1)

51-58: LGTM: Proper Rule of Five implementation.

The class correctly declares all five special member functions, making Pg_points_graph explicitly non-copyable and non-movable while defaulting the destructor. This satisfies the cppcoreguidelines-special-member-functions check.

include/vrp/fleet.hpp (1)

65-67: LGTM: Rule of Five with proper noexcept move operations.

Good implementation. The noexcept specifiers on move operations enable optimal container performance.

Minor: The indentation is inconsistent with the rest of the class (missing leading spaces).

include/vrp/pd_problem.hpp (1)

48-60: LGTM: Proper non-copyable/non-movable semantics.

The class manages static problem pointers across multiple related classes, making non-copyable/non-movable semantics the correct choice. All five special member functions are explicitly declared, satisfying the Rule of Five.

include/yen/ksp.hpp (1)

71-74: LGTM! Appropriate Rule of 5 compliance.

Deleting copy/move operations is correct here since Pgr_ksp manages a raw pointer (m_vis) with manual new/delete. This prevents double-delete bugs from accidental copies.

@cvvergara cvvergara marked this pull request as draft January 3, 2026 18:26
@mayurgalhate mayurgalhate force-pushed the clang-tidy-special-member-functions branch 2 times, most recently from 6d85782 to 467fd8a Compare January 5, 2026 07:18
@mayurgalhate mayurgalhate marked this pull request as ready for review January 5, 2026 07:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Fix all issues with AI Agents 🤖
In @include/bdAstar/bdAstar.hpp:
- Around line 83-86: Pgr_bdAstar is declaring defaulted copy/move special
members while its base class Pgr_bidirectional explicitly deletes them, which
makes these defaults implicitly deleted; remove the four lines that default the
copy constructor, copy assignment, move constructor, and move assignment for
Pgr_bdAstar (the declarations referencing Pgr_bdAstar(const Pgr_bdAstar&),
Pgr_bdAstar& operator=(const Pgr_bdAstar&), Pgr_bdAstar(Pgr_bdAstar&&), and
Pgr_bdAstar& operator=(Pgr_bdAstar&&)) so the class relies on the base’s deleted
semantics, or alternatively decide to enable copying/moving by modifying
Pgr_bidirectional accordingly if intended.

In @include/bdDijkstra/bdDijkstra.hpp:
- Around line 82-86: The class Pgr_bdDijkstra currently declares copy/move ctors
and assignment operators as = default but its base Pgr_bidirectional<G>
explicitly deletes them, so these will be implicitly deleted; change the
declarations in Pgr_bdDijkstra to explicitly delete the copy constructor, copy
assignment, move constructor and move assignment (mark each with = delete) to
match the base class semantics and avoid confusing/defaulted declarations
referencing Pgr_bdDijkstra(const Pgr_bdDijkstra&), Pgr_bdDijkstra&
operator=(const Pgr_bdDijkstra&), Pgr_bdDijkstra(Pgr_bdDijkstra&&) and
Pgr_bdDijkstra& operator=(Pgr_bdDijkstra&&).

In @include/cpp_common/line_vertex.hpp:
- Around line 64-67: The copy assignment operator for Line_vertex should be
defaulted instead of manually calling cp_members; replace the current
Line_vertex& operator=(const Line_vertex &v) implementation with a defaulted
declaration (use Line_vertex& operator=(const Line_vertex&) = default;) so the
compiler-generated trivial assignment is used, keeping consistency with the copy
constructor and avoiding the manual cp_members call.
- Around line 74-75: The class Line_vertex unnecessarily deletes move
operations; since its members are trivially copyable (int64_t, double), restore
move semantics by replacing the deleted move constructor and move assignment
with defaulted ones (or remove those declarations to let the compiler generate
them): change Line_vertex(Line_vertex&&) = delete; and Line_vertex&
operator=(Line_vertex&&) = delete; to Line_vertex(Line_vertex&&) = default; and
Line_vertex& operator=(Line_vertex&&) = default; so containers can move
Line_vertex efficiently.

In @include/vrp/fleet.hpp:
- Around line 65-68: Align the indentation of the three special-member
declarations (~Fleet(), Fleet(Fleet&&) noexcept, and Fleet& operator=(Fleet&&)
noexcept) to match surrounding class member indentation (use the same
column/spacing as other members) so they are consistently formatted with the
rest of the class; update whitespace only—no semantic changes.
♻️ Duplicate comments (3)
include/vrp/solution.hpp (1)

64-72: Defaulted special member functions are appropriate for this class.

The class members (EPSILON, fleet, trucks) are all copyable and movable, making defaulted operations valid. The static members don't affect copy/move semantics.

Consider adding noexcept to move operations for optimal std::vector reallocation performance, as noted in previous review.

include/chinese/chinesePostman.hpp (1)

64-68: Correctly deletes copy/move operations for resource-managing class.

The class manages resources (raw pointers in edgeToIdx pointing into originalEdges) and has a user-defined destructor. Deleting copy/move operations prevents undefined behavior from shallow copies.

The trailing whitespace on line 64 and inconsistent indentation were noted in previous review.

include/yen/ksp.hpp (1)

131-135: Fix inconsistent indentation (duplicate issue).

Lines 131-134 use 5 spaces of indentation while surrounding member declarations (lines 128-129) use 10 spaces. Adjust these lines to use 10 spaces for consistency.

🔎 Proposed fix for consistent indentation
      class Visitor {
       public:
          Visitor() = default;
          virtual ~Visitor() {}

-     Visitor(const Visitor&) = delete;
-     Visitor& operator=(const Visitor&) = delete;
-     Visitor(Visitor&&) = delete;
-     Visitor& operator=(Visitor&&) = delete;
-
+          Visitor(const Visitor&) = delete;
+          Visitor& operator=(const Visitor&) = delete;
+          Visitor(Visitor&&) = delete;
+          Visitor& operator=(Visitor&&) = delete;
+
          virtual void on_insert_first_solution(const Path) const {
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3553dc and 467fd8a.

📒 Files selected for processing (14)
  • include/bdAstar/bdAstar.hpp
  • include/bdDijkstra/bdDijkstra.hpp
  • include/chinese/chinesePostman.hpp
  • include/cpp_common/assert.hpp
  • include/cpp_common/basic_vertex.hpp
  • include/cpp_common/bidirectional.hpp
  • include/cpp_common/line_vertex.hpp
  • include/cpp_common/messages.hpp
  • include/trsp/trspHandler.hpp
  • include/vrp/fleet.hpp
  • include/vrp/pd_problem.hpp
  • include/vrp/solution.hpp
  • include/withPoints/withPoints.hpp
  • include/yen/ksp.hpp
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:32.986Z
Learning: In pgRouting's .clang-tidy file (and similar list configurations), the last line of lists should not have a trailing comma, per project convention.
📚 Learning: 2025-12-30T19:45:32.986Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:32.986Z
Learning: In pgRouting's .clang-tidy file (and similar list configurations), the last line of lists should not have a trailing comma, per project convention.

Applied to files:

  • include/chinese/chinesePostman.hpp
🧬 Code graph analysis (3)
include/vrp/pd_problem.hpp (1)
src/pickDeliver/pd_problem.cpp (1)
  • PD_problem (40-47)
include/vrp/fleet.hpp (1)
src/pickDeliver/fleet.cpp (2)
  • Fleet (50-54)
  • Fleet (56-63)
include/vrp/solution.hpp (1)
src/pickDeliver/solution.cpp (1)
  • Solution (232-240)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (9)
include/cpp_common/messages.hpp (1)

43-47: Special member functions correctly declared for non-transferable design.

The explicit deletion of move semantics (along with the already-deleted copy semantics) makes Pgr_messages non-copyable and non-movable. While std::ostringstream members are movable, deleting move operations here appears to be a deliberate design choice to prevent message state transfer. The defaulted destructor is appropriate.

include/cpp_common/basic_vertex.hpp (1)

56-58: LGTM! Rule of Five completed appropriately.

The defaulted move constructor, move assignment operator, and destructor appropriately complete the special member functions for this class. Since the class contains only a trivial int64_t member, defaulting these operations is the correct choice.

include/withPoints/withPoints.hpp (1)

53-58: LGTM! Special member functions consistent with non-copyable/non-movable base class.

The deleted copy/move operations are required since the base class Pgr_messages is non-copyable and non-movable. The defaulted destructor is appropriate. These declarations correctly enforce the non-transferable design inherited from the base class.

include/vrp/pd_problem.hpp (1)

48-60: LGTM! Non-transferable design appropriate for problem state manager.

The deleted copy/move operations are correct for this class. Based on the constructor implementation (which sets static problem pointers across multiple classes: Dnode, Fleet, Solution, Tw_node, PD_Orders, and Vehicle), copying or moving would create conflicts with shared static state. The non-transferable design enforces single-ownership semantics for the problem state.

include/cpp_common/bidirectional.hpp (1)

82-87: Correctly deletes special member functions.

The class has a reference member (G &graph) and a non-copyable std::ostringstream member, making copy/move operations impossible. Explicitly deleting them clarifies intent and satisfies the clang-tidy rule, addressing the concern from the previous review.

include/trsp/trspHandler.hpp (1)

118-122: Appropriate deletion of copy/move for handler class.

TrspHandler manages complex algorithm state (multiple containers, maps, priority queues). Deleting copy/move operations prevents accidental copies and enforces single-ownership semantics, which is appropriate for handler/controller classes.

include/cpp_common/assert.hpp (2)

147-148: LGTM! Good modernization of exception specification.

The changes from throw() to noexcept and adding override are best practice improvements that modernize the code while maintaining the same semantics.


150-153: Previous critical issue resolved—exception is now throwable.

The copy and move constructors are now defaulted (not deleted), which correctly allows the exception to be thrown. Deleting the assignment operators is appropriate for exception types.

include/yen/ksp.hpp (1)

71-74: LGTM! Correct special member function declarations for manual memory management.

Deleting copy and move operations is appropriate given that Pgr_ksp manages a raw pointer (m_vis) with manual allocation/deallocation. This prevents double-free errors.

@mayurgalhate mayurgalhate force-pushed the clang-tidy-special-member-functions branch from 467fd8a to 734c558 Compare January 5, 2026 08:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @include/bdAstar/bdAstar.hpp:
- Around line 83-86: The four defaulted special members in Pgr_bdAstar
(Pgr_bdAstar(const Pgr_bdAstar&), operator=(const Pgr_bdAstar&),
Pgr_bdAstar(Pgr_bdAstar&&), operator=(Pgr_bdAstar&&)) are invalid because the
base class Pgr_bidirectional has those operations deleted; remove these
defaulted declarations from Pgr_bdAstar or explicitly declare them deleted to
match the base class (i.e., either delete the copy/move ctor/assign in
Pgr_bdAstar or simply remove those lines so the base-class-deleted semantics
apply).

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
include/cpp_common/assert.hpp (1)

142-161: Critical: Duplicate class member definitions will cause compilation failure.

The class contains duplicate definitions of all members:

  • const std::string str; appears at both line 143 and line 155
  • what(), constructor, and destructor are declared twice (lines 146-148 vs 158-160)

The old member declarations (lines 154-161) were not removed when adding the new special member functions. This code will not compile.

🔎 Proposed fix: Remove duplicate declarations
     AssertFailedException(const AssertFailedException&) = default;
     AssertFailedException(AssertFailedException&&) = default;
     AssertFailedException& operator=(const AssertFailedException&) = delete;  // cannot assign const member
     AssertFailedException& operator=(AssertFailedException&&) = delete;       // cannot assign const member
- private:
-     const std::string str;   ///< Holds what() we got as message
-
- public:
-     const char *what() const noexcept override;
-     explicit AssertFailedException(std::string msg);
-     ~AssertFailedException() noexcept override {}
 };
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 734c558 and 7460044.

📒 Files selected for processing (2)
  • include/bdAstar/bdAstar.hpp
  • include/cpp_common/assert.hpp
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:32.986Z
Learning: In pgRouting's .clang-tidy file (and similar list configurations), the last line of lists should not have a trailing comma, per project convention.
📚 Learning: 2025-04-25T00:59:52.580Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 2868
File: src/contraction/contractionHierarchies_driver.cpp:47-56
Timestamp: 2025-04-25T00:59:52.580Z
Learning: In pgRouting, driver functions like `pgr_contractionHierarchies` assume that callers within the project will pass valid non-null pointers, as these functions are only used internally with well-defined call patterns. Null checks on the pointers themselves (as opposed to their dereferenced values) are considered unnecessary since the caller is guaranteed to pass references to variables.

Applied to files:

  • include/bdAstar/bdAstar.hpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
include/cpp_common/assert.hpp (2)

150-151: Excellent fix for the copy/move constructors.

Defaulting the copy and move constructors correctly addresses the previous critical issue. Exception types must be copyable for throw to work, and this implementation now satisfies that requirement while maintaining the rule-of-five compliance flagged by clang-tidy.


152-153: Assignment operators correctly deleted.

Deleting the assignment operators is appropriate since the class contains a const member (str), which makes assignment impossible anyway. The inline comments clearly document this rationale.

@mayurgalhate mayurgalhate force-pushed the clang-tidy-special-member-functions branch 2 times, most recently from 734c558 to b9bd496 Compare January 5, 2026 14:59
Copy link
Member

@cvvergara cvvergara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to reduce the scope of your PR
Because you are adding so many new default constructors.

From the clang-tidy documentation cppcoreguidelines-special-member-functions have 4 options that have default false.

Do the .clang-tidy modification to add
cppcoreguidelines-special-member-functions
and the 4 options but with value true

You will need to restore the files that you modified

git fetch upstream
git checkout upstream/develop path/to/file

in each of the files that you modified under include
What is the command to find out the names of the files that are different from upstream/develop?

Do the fixes again, there will be less lines that you add.
and commit, the fixes and the clang tidy file

Which is not modified here.

@cvvergara cvvergara marked this pull request as draft January 5, 2026 15:46
@mayurgalhate mayurgalhate marked this pull request as ready for review January 5, 2026 19:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
include/cpp_common/basic_vertex.hpp (1)

48-49: Consider defaulting the copy constructor for consistency.

The explicit copy constructor performs the same operation as the default copy constructor would (copying the int64_t id member). Since the copy assignment operator (line 54) and other special members are already defaulted, consider defaulting this constructor as well for consistency.

🔎 Proposed refactor
-    Basic_vertex(const Basic_vertex &v) :
-        id(v.id) {}
+    Basic_vertex(const Basic_vertex&) = default;
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9bd496 and 301f532.

📒 Files selected for processing (6)
  • .clang-tidy
  • include/cpp_common/assert.hpp
  • include/cpp_common/basic_vertex.hpp
  • include/cpp_common/messages.hpp
  • include/vrp/fleet.hpp
  • include/vrp/pd_problem.hpp
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
🧬 Code graph analysis (2)
include/vrp/fleet.hpp (1)
src/pickDeliver/fleet.cpp (2)
  • Fleet (50-54)
  • Fleet (56-63)
include/vrp/pd_problem.hpp (1)
src/pickDeliver/pd_problem.cpp (1)
  • PD_problem (40-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (7)
.clang-tidy (2)

2-11: LGTM! Configuration correctly enables the new check.

The addition of cppcoreguidelines-special-member-functions to the checks list is correctly formatted with no trailing comma on the last entry, following the repository's convention.


13-23: LGTM! Comprehensive check options.

All sub-checks for special member functions are appropriately enabled, ensuring thorough enforcement of the C++ Rule of Five across the codebase.

include/cpp_common/messages.hpp (1)

43-45: LGTM! Special member functions correctly align with non-copyable members.

The defaulted destructor and deleted move operations are appropriate since the class contains mutable std::ostringstream members, which are neither copyable nor movable. The class is now explicitly non-copyable and non-movable, making the design intent clear.

include/vrp/fleet.hpp (1)

65-68: LGTM! Correctly completes the Rule of Five.

The defaulted move operations (correctly marked noexcept) and destructor properly complement the existing user-defined copy constructor at src/pickDeliver/fleet.cpp:49-53. This makes the class's copy/move semantics explicit and enables efficient move operations with standard containers.

include/cpp_common/assert.hpp (1)

148-152: LGTM! Exception semantics correctly implemented.

The defaulted copy and move constructors satisfy the C++ requirement that exception types be copy-constructible for throw operations (lines 99, 123). Deleted assignment operators are appropriate since the const std::string str member prevents assignment anyway. The noexcept specifications on move operations follow best practices.

include/vrp/pd_problem.hpp (1)

48-53: LGTM! Non-copyable, non-movable design is appropriate.

Deleting all copy and move operations is correct for this class, which manages global state by setting static problem pointers across multiple classes (see src/pickDeliver/pd_problem.cpp:39-46). The explicit deletions prevent accidental copying or moving that could corrupt the shared state model.

include/cpp_common/basic_vertex.hpp (1)

55-57: LGTM! Rule of Five correctly implemented.

The added special member functions (destructor, move constructor, and move assignment operator) are appropriately defaulted, completing the Rule of Five for this class. Since Basic_vertex contains only a trivial member (int64_t id), defaulting these operations is correct and ensures the class follows C++ Core Guidelines.

@mayurgalhate
Copy link
Contributor Author

I have restored all modified files from upstream/develop, updated the .clang-tidy to enable cppcoreguidelines-special-member-functions with all 4 options set to true, and reapplied the fixes. The changes are now minimal.

Copy link
Member

@cvvergara cvvergara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvvergara cvvergara marked this pull request as draft January 5, 2026 22:45
@mayurgalhate mayurgalhate marked this pull request as ready for review January 6, 2026 09:33
@mayurgalhate
Copy link
Contributor Author

Resolved linter errors for spacing/indentation in messages.hpp, pd_problem.hpp, and basic_vertex.hpp

Copy link
Member

@cvvergara cvvergara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alignments are wrong.

  • Please make sure you are using your .editorconfig appropriately
  • Do not modify exisitng code/coments: that includes changing alignment
    Please install meld and use
git difftool -t meld -y upstream/develop

And make your PR with the least amount of changes

@cvvergara cvvergara marked this pull request as draft January 6, 2026 12:57
@mayurgalhate mayurgalhate marked this pull request as ready for review January 6, 2026 17:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI Agents
In @.clang-tidy:
- Line 27: Revert the spacing change on the "FormatStyle" entry in .clang-tidy
so it matches the repository's existing YAML formatting (restore the previous
multiple-space gap between the key "FormatStyle" and its value "none" or
otherwise match the prior commit's exact spacing) to avoid unnecessary churn; do
this by editing the "FormatStyle" line back to the original spacing used in the
file.

In @include/vrp/pd_problem.hpp:
- Line 46: Fix the typo in the comment that reads "Not wllowing to copy the
problem" by updating it to a clearer, correct wording such as "Not allowing to
copy the problem" or better "Disallow copying of the problem" in
include/vrp/pd_problem.hpp so the comment correctly conveys the intent of the
copy-prevention declaration.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db8e9fa and 873fcc5.

📒 Files selected for processing (6)
  • .clang-tidy
  • include/cpp_common/assert.hpp
  • include/cpp_common/basic_vertex.hpp
  • include/cpp_common/messages.hpp
  • include/vrp/fleet.hpp
  • include/vrp/pd_problem.hpp
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
🧬 Code graph analysis (2)
include/vrp/fleet.hpp (1)
src/pickDeliver/fleet.cpp (2)
  • Fleet (50-54)
  • Fleet (56-63)
include/vrp/pd_problem.hpp (1)
src/pickDeliver/pd_problem.cpp (1)
  • PD_problem (40-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
include/cpp_common/basic_vertex.hpp (1)

55-57: LGTM - Move semantics properly enabled.

The defaulted move constructor, move assignment, and destructor complete the special member function set for this class. Since Basic_vertex contains only a trivially copyable int64_t member, the defaulted move operations are safe and efficient.

include/vrp/fleet.hpp (1)

65-67: LGTM - Move semantics intentionally disabled.

The explicit deletion of move operations while retaining copy semantics is appropriate for this fleet management class. This design prevents accidental moves of the vehicle collection while allowing explicit copies when needed.

.clang-tidy (1)

10-23: LGTM - Special member function checks properly configured.

The addition of cppcoreguidelines-special-member-functions with all five options enabled (DefaultConstructor, CopyConstructor, CopyAssignment, MoveConstructor, MoveAssignment) will enforce explicit declaration of special member functions across the codebase, improving code clarity and preventing unintended behavior.

Note: Line 11 correctly omits a trailing comma, following the repository's convention for list entries.

include/cpp_common/messages.hpp (1)

43-45: LGTM - Message class correctly made non-movable.

Adding the defaulted destructor and deleted move operations completes the special member function set for this non-copyable, non-movable message accumulator class. This design is appropriate given the mutable ostringstream members and the class's role as a message sink.

include/cpp_common/assert.hpp (1)

148-152: LGTM - Exception class properly made copyable and movable.

The defaulted copy and move constructors satisfy the requirement that exception classes be copy-constructible for throwing. Deleting the assignment operators is acceptable since exception objects are rarely reassigned after construction. This resolves the previous critical issue where deleted copy/move constructors would have prevented throwing the exception.

include/vrp/pd_problem.hpp (1)

48-51: LGTM! Explicit special member functions correctly implement the rule of five.

The explicit declarations make the class semantics clear: the class is non-copyable and non-movable, which is appropriate given that the parameterized constructor sets static pointers across multiple classes. The defaulted destructor is correct since no special cleanup is required.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @.clang-tidy:
- Around line 14-24: The CheckOptions entries for
cppcoreguidelines-special-member-functions use invalid keys (DefaultConstructor,
CopyConstructor, CopyAssignment, MoveConstructor, MoveAssignment) which
clang-tidy will ignore; remove those invalid option keys and replace them only
with the documented options (AllowSoleDefaultDtor, AllowMissingMoveFunctions,
AllowMissingMoveFunctionsWhenCopyIsDeleted) as needed, ensuring the CheckOptions
list references the correct option names for
cppcoreguidelines-special-member-functions.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 873fcc5 and 85a5f08.

📒 Files selected for processing (1)
  • .clang-tidy
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.clang-tidy (1)

10-12: LGTM! Trailing comma convention correctly followed.

The additions to the Checks list correctly follow the project convention: the last entry (cppcoreguidelines-special-member-functions on line 12) has no trailing comma, while preceding entries have trailing commas. Based on learnings, this improves diffs and consistency across configuration files.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @.clang-tidy:
- Around line 10-11: The .clang-tidy config mistakenly adds
cppcoreguidelines-prefer-member-initializer instead of the intended
cppcoreguidelines-special-member-functions; replace the incorrect check name
(cppcoreguidelines-prefer-member-initializer) with
cppcoreguidelines-special-member-functions in the checks list so the linter
enforces special-member-functions (copy/move/dtor) as the PR describes, and
verify there are no duplicate or conflicting entries for these check names
elsewhere in the config.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85a5f08 and 4310c04.

📒 Files selected for processing (1)
  • .clang-tidy
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @.clang-tidy:
- Around line 14-24: The CheckOptions block for
cppcoreguidelines-special-member-functions contains invalid keys
(DefaultConstructor, CopyConstructor, CopyAssignment, MoveConstructor,
MoveAssignment) which clang-tidy will ignore; either delete this CheckOptions
section to use defaults or replace it with valid options (AllowSoleDefaultDtor,
AllowMissingMoveFunctions, AllowMissingMoveFunctionsWhenCopyIsDeleted) and set
the desired values; update the .clang-tidy entry for
cppcoreguidelines-special-member-functions accordingly and remove the duplicate
comment block if present.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4310c04 and 4bf1179.

📒 Files selected for processing (1)
  • .clang-tidy
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-30T19:45:24.426Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:9-11
Timestamp: 2025-12-30T19:45:24.426Z
Learning: In .clang-tidy files (and similar list-based configuration files), the last entry in a list should not have a trailing comma, following project convention. Enforce that lists do not end with a comma to improve diffs and consistency across configuration files.

Applied to files:

  • .clang-tidy
📚 Learning: 2025-12-30T19:45:40.183Z
Learnt from: cvvergara
Repo: pgRouting/pgrouting PR: 3004
File: .clang-tidy:11-11
Timestamp: 2025-12-30T19:45:40.183Z
Learning: In any .clang-tidy configuration files, ensure that the last element of a list does not have a trailing comma, to follow the repository's coding convention. This applies to all pgRouting/.clang-tidy files across the codebase.

Applied to files:

  • .clang-tidy
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.clang-tidy (1)

10-12: LGTM on the Checks list.

The cppcoreguidelines-special-member-functions check is now correctly added, and the list follows the convention of no trailing comma on the last entry.

@mayurgalhate
Copy link
Contributor Author

Hi @cvvergara, I’ve resolved the .clang-tidy conflicts, fixed all alignment/linter issues, and all checks are passing. Could you please take a look and approve if everything looks good?

@cvvergara cvvergara merged commit 12ebc1e into pgRouting:develop Jan 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants