You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable cppcoreguidelines-pro-type-const-cast by removing it from the list of disabled checks in .clang-tidy, as mentioned in my comment on Clang tidy checks that need fixes #3036.
tested with clang-tidy 14 on develop 0385ea7. the check reports 4 warning and 0 after my changes
changes in code - char* type to const char* type in the two headers and removed the 4 const_cast.
All CI checks passed
@pgRouting/admins
Summary by CodeRabbit
Refactor
Made vertex and edge type labels immutable, improving type safety without changing their values or behavior.
Chores
Enabled the const-cast guideline in static analysis.
No actionable comments were generated in the recent review.
Walkthrough
Runtime type fields now use const char*. Vertex and edge tuple initialization uses string literals instead of const_cast. The clang-tidy configuration no longer excludes the const-cast check.
Changes
Runtime type fields and tuple initialization
Layer / File(s)
Summary
Const type fields and tuple initialization include/c_types/contracted_rt.h, include/c_types/contractionHierarchies_rt.h, include/cpp_common/to_postgres.hpp, src/contraction/contractGraph_driver.cpp, .clang-tidy
The runtime type fields change from char* to const char*. Vertex and edge tuple initializers use string literals instead of const_cast. The clang-tidy configuration removes the const-cast exclusion.
This change makes two type fields const-correct and enables a static-analysis check. It should not change runtime behavior, and no merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: enabling the clang-tidy check cppcoreguidelines-pro-type-const-cast. The changeset removes that check from the disabled list in .clang-tidy. It also changes char* to c…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: enabling the clang-tidy check cppcoreguidelines-pro-type-const-cast. The changeset removes that check from the disabled list in .clang-tidy. It also changes char* to const char* in two headers and removes const_cast uses in two source files, which the title does not mention. Those edits are the fixes that let the check pass, so the title matches the primary change.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks each type with care, Const strings now rest safely there. “v” and “e” go hopping by, No const_cast in their path to fly. The tidy check is back in sight.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: dd22713f-48a0-43f0-b949-2677a2c9b18e
Commits
Reviewing files that changed from the base of the PR and between b00d03d and 3eb05c4.
Files selected for processing: 5
.clang-tidy
include/c_types/contracted_rt.h
include/c_types/contractionHierarchies_rt.h
include/cpp_common/to_postgres.hpp
src/contraction/contractGraph_driver.cpp
Files with no reviewable changes: 1
.clang-tidy
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3036
Changes in this PR:
Enable
cppcoreguidelines-pro-type-const-castby removing it from the list of disabled checks in .clang-tidy, as mentioned in my comment on Clang tidy checks that need fixes #3036.tested with clang-tidy 14 on develop 0385ea7. the check reports 4 warning and 0 after my changes
changes in code - char* type to const char* type in the two headers and removed the 4 const_cast.
All CI checks passed
@pgRouting/admins
Summary by CodeRabbit