Skip to content

Conversation

@Eternity0207
Copy link

@Eternity0207 Eternity0207 commented Dec 27, 2025

Summary by CodeRabbit

  • Chores

    • Added additional C++ code-quality checks to the static analysis configuration.
  • Refactor

    • Internal refactor of interrupt-handling implementation to improve maintainability; no behavioral or public API changes.
  • Chores

    • No changes to formatting rules, warning-as-error settings, or header-filtering behavior.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 27, 2025

Walkthrough

Replaced the CHECK_FOR_INTERRUPTS() macro with a static inline function in include/cpp_common/interruption.hpp and enabled four cppcoreguidelines checks in .clang-tidy (avoid-reference-coroutine-parameters, init-variables, prefer-member-initializer, special-member-functions); no other behavioral changes detected.

Changes

Cohort / File(s) Summary
Clang-tidy configuration
​.clang-tidy
Added cppcoreguidelines-avoid-reference-coroutine-parameters, cppcoreguidelines-init-variables, cppcoreguidelines-prefer-member-initializer, and cppcoreguidelines-special-member-functions to Checks; adjusted formatting (trailing comma/line placement) to insert new entries without reordering existing checks.
Interrupt handling header
include/cpp_common/interruption.hpp
Removed macro CHECK_FOR_INTERRUPTS() and introduced an equivalent static inline void CHECK_FOR_INTERRUPTS() function with the same conditional check invoking ProcessInterrupts() (macro → function conversion, internal linkage).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • cvvergara

Poem

🐇 I nibbled lines and hopped about,

A macro swapped — no need to shout.
Four tidy checks I helped to sow,
Quiet changes, swift and slow.
Hooray — the code can safely flow.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'cppcoreguidelines-avoid-do-while' but the actual changes enable other cppcoreguidelines checks (init-variables, prefer-member-initializer, special-member-functions) and modify interruption.hpp. The title is partially misleading. Revise the title to accurately reflect the actual changes, such as: 'Enable additional cppcoreguidelines checks and refactor CHECK_FOR_INTERRUPTS macro to function'
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 a798fea and 8b5c5c6.

📒 Files selected for processing (1)
  • .clang-tidy
🧰 Additional context used
🧠 Learnings (4)
📓 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: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-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:

  • .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)

12-12: Correct formatting: no trailing comma on the last list item.

The last check entry correctly omits the trailing comma, following the project's coding convention.

Based on learnings, the last line of lists should not have a trailing comma per project convention.


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: 1

📜 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 f759746.

📒 Files selected for processing (1)
  • .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)

9-9: Good formatting practice!

Adding the trailing comma makes future additions to the checks list cleaner by avoiding unnecessary line changes.

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.

Please only fix the file
include/cpp_common/interruption.hpp
By ignoring any clang-tidy check on the problematic do while.

@Eternity0207 Eternity0207 changed the title clang-tidy : added cppcoreguidelines-avoid-do-while clang-tidy : added cppcoreguidelines-avoid-do-while and fix interruption.hpp Dec 31, 2025
@Eternity0207
Copy link
Author

I've fixed the reuqested file and now there is no warning due to the cppcoreguideline-avoid-do-while.

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

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 879d524 and 432a623.

📒 Files selected for processing (1)
  • include/cpp_common/interruption.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.
⏰ 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/cpp_common/interruption.hpp (1)

87-91: No issues found. The .clang-tidy file is present and includes the cppcoreguidelines-avoid-do-while check as expected. All 15+ call sites of CHECK_FOR_INTERRUPTS() throughout the codebase follow a consistent standalone statement pattern (directly followed by try-catch blocks), making them fully compatible with the static inline function form.

@cvvergara cvvergara marked this pull request as draft January 3, 2026 16:32
@Eternity0207 Eternity0207 force-pushed the mani-clean-clang-tidy branch from e619b94 to dc2ba4a Compare January 3, 2026 18:32
@Eternity0207 Eternity0207 marked this pull request as ready for review January 7, 2026 17:23
@Eternity0207 Eternity0207 requested a review from cvvergara January 8, 2026 17:32
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