Skip to content

Enable cppcoreguidelines-avoid-c-arrays for safer alternatives#3092

Open
Priyanshu23146 wants to merge 1 commit intopgRouting:developfrom
Priyanshu23146:priyanshu-clangtidy-rule
Open

Enable cppcoreguidelines-avoid-c-arrays for safer alternatives#3092
Priyanshu23146 wants to merge 1 commit intopgRouting:developfrom
Priyanshu23146:priyanshu-clangtidy-rule

Conversation

@Priyanshu23146
Copy link

@Priyanshu23146 Priyanshu23146 commented Mar 10, 2026

… arrays and encourage safer alternatives

Fixes # .

Changes proposed in this pull request:

  • Enable clang-tidy rule cppcoreguidelines-avoid-c-arrays
  • Detect usage of C-style arrays
  • Encourage use of safer alternatives such as std::array or std::vector

@pgRouting/admins

Summary by CodeRabbit

  • Chores
    • Enhanced code quality checks for stricter adherence to C++ coding standards and memory safety practices.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a1fec260-16bd-4892-8c7d-adaa4126d285

📥 Commits

Reviewing files that changed from the base of the PR and between e06c177 and 4c3e89b.

📒 Files selected for processing (1)
  • .clang-tidy

Walkthrough

The .clang-tidy configuration file is updated to enable the cppcoreguidelines-avoid-c-arrays check, normalize string literal quoting for consistency, and add new options to the cppcoreguidelines-special-member-functions check including AllowMissingMoveFunctions and AllowMissingMoveFunctionsWhenCopyIsDeleted.

Changes

Cohort / File(s) Summary
Clang-tidy Configuration
.clang-tidy
Enabled cppcoreguidelines-avoid-c-arrays check, normalized string quotes in WarningsAsErrors and HeaderFilterRegex configuration, and added cppcoreguidelines-special-member-functions options for move function handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

Enhancement, C/C++

Suggested reviewers

  • cvvergara

Poem

🐰 A tidy code garden we now maintain,
With C-arrays banished, special members ordained,
Move functions dancing in configuration's light,
Guidelines enforced—the code shines bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling the cppcoreguidelines-avoid-c-arrays clang-tidy rule for safer array handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant