Skip to content

Conversation

@Sohamsig
Copy link

@Sohamsig Sohamsig commented Dec 18, 2025

Summary by CodeRabbit

  • Chores
    • Updated linting configuration for more consistent rule formatting.
    • Added a new lint rule to flag use of magic numbers.
    • Minor formatting tweak to the checks list to improve consistency.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Added cppcoreguidelines-avoid-magic-numbers to the Checks list in .clang-tidy and inserted a trailing comma after cppcoreguidelines-avoid-reference-coroutine-parameters; no logic or public API changes.

Changes

Cohort / File(s) Summary
Clang-Tidy configuration
\.clang-tidy
Added cppcoreguidelines-avoid-magic-numbers to Checks; added a trailing comma to the cppcoreguidelines-avoid-reference-coroutine-parameters entry.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Verify the intended check name and that the trailing comma fits the YAML/clang-tidy formatting.

Poem

🐰 I nudged a rule, then skipped along,

A comma placed where it was strong,
A magic-number guard hopped in to play,
The tidy file shines — hip hooray!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title claims to add cppcoreguidelines-avoid-magic-numbers, which matches the actual change in .clang-tidy configuration.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 2f5a0ce.

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

@Sohamsig Sohamsig changed the title clang-tidy: add cppcoreguidelines-pro-type-vararg check clang-tidy: add cppcoreguidelines-avoid-magic-numbers, Dec 18, 2025
@Sohamsig Sohamsig changed the title clang-tidy: add cppcoreguidelines-avoid-magic-numbers, clang-tidy: add cppcoreguidelines-avoid-magic-numbers Dec 22, 2025
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.

@Sohamsig

I compiled locally using:

CXX=clang++ CC=clang cmake  -DUSE_CLANG_TIDY=ON  -DBUILD_HTML=ON -DPOSTGRESQL_BIN=${PGBIN} ..

and these are some of the many warnings I get that are not fixed

/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:69:18: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
   69 |          EPSILON(0.0001),
      |                  ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:76:20: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
   76 |          EPSILON = 0.0001,
      |                    ^
[ 15%] Building CXX object src/allpairs/CMakeFiles/allpairs.dir/allpairs_driver.cpp.o
[ 16%] Building CXX object src/withPoints/CMakeFiles/withPoints.dir/withPoints.cpp.o
[ 17%] Building CXX object src/pickDeliver/CMakeFiles/pickDeliver.dir/fleet.cpp.o
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:69:18: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
   69 |          EPSILON(0.0001),
      |                  ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/vrp/solution.hpp:76:20: warning: 0.0001 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
   76 |          EPSILON = 0.0001,
      |                    ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/cpp_common/base_graph.hpp:831:32: warning: 0.5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
  831 |              graph[e].cost = (-0.5)*edge.cost;
      |                                ^
/home/vicky/pgrouting/pgrouting/cvvergara/include/cpp_common/base_graph.hpp:843:36: warning: 0.5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
  843 |                  graph[e].cost = (-0.5)*edge.reverse_cost;

Your CI action workflows are not activated.

@cvvergara cvvergara marked this pull request as draft December 26, 2025 15:50
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.

2 participants