clang-tidy : added cppcoreguidelines-avoid-do-while and fix interruption.hpp#3016
clang-tidy : added cppcoreguidelines-avoid-do-while and fix interruption.hpp#3016Eternity0207 wants to merge 6 commits intopgRouting:developfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughReplaced the Changes
Sequence Diagram(s)(omitted — changes do not introduce a new multi-component control flow that requires a sequence diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 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.
cvvergara
left a comment
There was a problem hiding this comment.
Please only fix the file
include/cpp_common/interruption.hpp
By ignoring any clang-tidy check on the problematic do while.
|
I've fixed the reuqested file and now there is no warning due to the cppcoreguideline-avoid-do-while. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 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 thecppcoreguidelines-avoid-do-whilecheck as expected. All 15+ call sites ofCHECK_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.
e619b94 to
dc2ba4a
Compare
8b5c5c6 to
788451d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @include/cpp_common/interruption.hpp:
- Around line 87-91: Rename the ALL_CAPS function to follow normal function
naming (e.g., change CHECK_FOR_INTERRUPTS to checkForInterrupts) and update its
definition to call INTERRUPTS_PENDING_CONDITION() and ProcessInterrupts() as
before; to preserve backward compatibility, add a thin deprecated wrapper named
CHECK_FOR_INTERRUPTS that simply calls checkForInterrupts(). Ensure you update
or leave call sites accordingly and keep INTERRUPTS_PENDING_CONDITION and
ProcessInterrupts references unchanged.
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.clang-tidyinclude/cpp_common/interruption.hpp
🧰 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 (2)
.clang-tidy (2)
12-12: Verify the intent: the check is currently disabled.The
-prefix oncppcoreguidelines-avoid-do-whilemeans this check is disabled, not enabled. The PR title says "added cppcoreguidelines-avoid-do-while" which typically implies enabling the check.If the intent is to enable this check (to enforce avoiding do-while loops), the line should be removed entirely, as
cppcoreguidelines-*on line 9 already enables all cppcoreguidelines checks by default.Current behavior: the check is explicitly disabled, so do-while loops will not trigger warnings.
45-45: No observable change detected.The AI summary indicates this line (
InheritParentConfig: true) is unchanged from the previous version. If this is an unintentional diff artifact, consider reverting to keep the commit clean.
|
On this comment it was asked to ignore the do-while, but you gave a different solution. Unfortunately this particular file has code that is deeply interlocked with PostgreSQL and even thou the tests pass for macos, and ubuntu, there are other OS like windows, fedora, etc. Specially windows, I am terrified of. I am not going to merge this solution. Remember: merging is not a requirement for task4 |
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.