| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting. Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a repository .clang-tidy config and a CI tidy job that installs LLVM/clang-tidy-22 and runs xmake check -y clang.tidy; modifies exception cleanup in ConstraintHelpers.cpp; and makes Log::Level explicitly map to spdlog levels with a simplified conversion. ChangesClang-tidy integration & CI
Code edits (independent maintenance changes)
Sequence Diagram(s)sequenceDiagram
participant Contributor as "Contributor / PR"
participant GitHub as "GitHub Actions"
participant Runner as "CI Runner"
participant Apt as "apt (package manager)"
participant Xmake as "xmake"
participant ClangTidy as "clang-tidy-22"
Contributor->>GitHub: push PR
GitHub->>Runner: start workflow (ci.yml)
Runner->>Apt: install llvm-22 and clang-tidy-22
Apt-->>Runner: packages installed
Runner->>Xmake: run `xmake check -y clang.tidy`
Xmake->>ClangTidy: invoke checks using `./.clang-tidy`
ClangTidy-->>Xmake: diagnostics (warnings → errors)
Xmake-->>Runner: exit code (pass/fail)
Runner-->>GitHub: workflow result
GitHub-->>Contributor: status (success/failure)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem🚥 Pre-merge checks | ✅ 4 | ❌ 1 ❌ Failed checks (1 warning)
✏️ 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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against the current code and only fix it if needed. Inline comments: In @.clang-tidy: - Around line 2-5: Update the .clang-tidy configuration so that Checks expands beyond only bugprone-string-constructor to include the targeted groups (e.g., modernize-*, cppcoreguidelines-*, readability-*, performance-*) and avoid making every warning an error immediately; modify the Checks field to include those groups and change WarningsAsErrors from "*" to either an explicit list of rule names or remove the wildcard (leave empty) while you run clang-tidy to generate a baseline/fix list, then reintroduce WarningsAsErrors once the baseline violations are fixed; refer to the existing Keys "Checks" and "WarningsAsErrors" in the file to implement these changes.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9a73baac-3251-4324-a91a-ead949838aec
📥 CommitsReviewing files that changed from the base of the PR and between e480ac2 and 9bff6f1.
📒 Files selected for processing (2)
Sorry, something went wrong.
There was a problem hiding this comment.
Adds a repository-wide clang-tidy configuration and introduces a CI job to run clang-tidy as a quality gate, aligning with issue #553’s goal of enforcing more modern C++ usage and reducing technical debt.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds a dedicated clang-tidy CI job using xmake’s check integration. |
| .clang-tidy | Introduces clang-tidy rules/config intended to be enforced by CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against the current code and only fix it if needed. Inline comments: In `@src/plugin/physics/src/system/ConstraintHelpers.cpp`: - Around line 94-99: The exception handler for storing a ConstraintInternal must not let cleanup throw: ensure ctx.physicsSystem.RemoveConstraint(joltConstraint) is called inside a protective no-throw block (e.g., wrap it in a try-catch) or use a non-throwing cleanup helper so that joltConstraint->Release() always runs even if RemoveConstraint throws; reference the same pattern used in DestroyConstraint() and apply it to the catch handling around RemoveConstraint and joltConstraint->Release().
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 88c50c10-8de2-4166-b7ce-b8747b3a4076
📥 CommitsReviewing files that changed from the base of the PR and between 672628c and 1d6040f.
📒 Files selected for processing (1)
Sorry, something went wrong.
There was a problem hiding this comment.
src/utils/log/src/Logger.hpp (2)🤖 Prompt for all review comments with AI agents40-58: ⚡ Quick win
Optional: collapse the if/else if dispatch in Log::Log using spdlog::log.
Now that ToSpdlogLevel maps reliably via static_cast, the entire manual dispatch chain can be replaced with a single spdlog::log call. This removes ~12 lines of boilerplate and eliminates the latent risk of silently missing a newly added Log::Level value (e.g., the current chain falls through to Trace as the default rather than forwarding trace explicitly).
♻️ Proposed simplification🤖 Prompt for AI Agentstemplate <typename T> inline void Log(Level level, const T &msg) noexcept { - using enum Log::Level; - - if (level == info) - Log::Info(msg); - else if (level == warning) - Log::Warning(msg); - else if (level == error) - Log::Error(msg); - else if (level == critical) - Log::Critical(msg); - else if (level == debug) - Log::Debug(msg); - else if (level == off) - return; - else - Log::Trace(msg); + spdlog::log(ToSpdlogLevel(level), msg); };Verify each finding against the current code and only fix it if needed. In `@src/utils/log/src/Logger.hpp` around lines 40 - 58, Replace the manual if/else dispatch in the template function Log (the Log::Log overload) with a single spdlog::log call using the existing ToSpdlogLevel conversion: first early-return on Level::off if you want to suppress logging, then call spdlog::log(ToSpdlogLevel(level), msg). Remove the long if/else chain and the "using enum Log::Level;" line; keep the template signature and rely on ToSpdlogLevel(Level) to map levels so new enum values won't silently fall through.
13-13: Pin Log::Level's underlying type to int to match spdlog::level::level_enum explicitly.
The static_cast on line 25 is valid because both Log::Level and spdlog::level::level_enum use int as their underlying type. However, spdlog::level::level_enum declares this explicitly (: int), while Log::Level relies on implicit default. Adding : int to Log::Level makes the coupling explicit and consistent, preventing any accidental incompatibility if the enum representation ever changes.
♻️ Proposed change🤖 Prompt for AI Agents-enum class Level { +enum class Level : int { trace = spdlog::level::level_enum::trace,Verify each finding against the current code and only fix it if needed. In `@src/utils/log/src/Logger.hpp` at line 13, The enum Log::Level should explicitly pin its underlying type to int to match spdlog::level::level_enum; update the declaration of enum class Level to use ": int" (e.g., enum class Level : int) so the static_cast to spdlog::level::level_enum (used elsewhere in Logger.hpp) is guaranteed safe and stable if defaults change.
Verify each finding against the current code and only fix it if needed. Nitpick comments: In `@src/utils/log/src/Logger.hpp`: - Around line 40-58: Replace the manual if/else dispatch in the template function Log (the Log::Log overload) with a single spdlog::log call using the existing ToSpdlogLevel conversion: first early-return on Level::off if you want to suppress logging, then call spdlog::log(ToSpdlogLevel(level), msg). Remove the long if/else chain and the "using enum Log::Level;" line; keep the template signature and rely on ToSpdlogLevel(Level) to map levels so new enum values won't silently fall through. - Line 13: The enum Log::Level should explicitly pin its underlying type to int to match spdlog::level::level_enum; update the declaration of enum class Level to use ": int" (e.g., enum class Level : int) so the static_cast to spdlog::level::level_enum (used elsewhere in Logger.hpp) is guaranteed safe and stable if defaults change.
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f854ab1b-93a1-4ab7-9f5b-36b895eb7d53
📥 CommitsReviewing files that changed from the base of the PR and between 1d6040f and 95f7bc1.
📒 Files selected for processing (2)
Sorry, something went wrong.
|
Sorry, something went wrong.
# Pull Request ## Description To ensure that the codebase follows good principles like modern usage of cpp, I added clang tidy configuration file with an automatic check inside CI. ## Related Issues (Put "None" if there are no related issues) close #553 ## Type of Change Please delete options that are not relevant. - Build/CI configuration change ## Changes Made List the main changes in this PR: - Added clang tidy config file - Add a gate in CI to check the code conformity to clang tidy ## Testing Describe the tests you ran to verify your changes. Please delete options that are not relevant. - Unit tests pass (`xmake test`) ### Test Environment - OS: macOS - Compiler: Clang ## Screenshots/Videos (Put "None" if there are no related issues) None ## Documentation Please delete options that are not relevant. - No documentation changes are required ## Checklist (Don't delete any options) - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Breaking Changes (Put "None" if there are no related issues) None ## Additional Notes (Put "None" if there are no related issues) None <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enforced stricter static-analysis rules (treat warnings as errors) and scoped checks to source files with repository formatting. * Added CI automation to run these static-analysis checks. * Aligned internal log level definitions with the logging backend for more consistent log behavior. * **Bug Fixes** * Improved cleanup behavior during constraint finalization to reduce errors and improve runtime stability when exceptions occur. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <copilot@github.com>
| Back | FazBrowse Home | New Git URL |
Pull Request
Description
To ensure that the codebase follows good principles like modern usage of cpp, I added clang tidy configuration file with an automatic check inside CI.
Related Issues (Put "None" if there are no related issues)
close #553
Type of Change
Please delete options that are not relevant.
Changes Made
List the main changes in this PR:
Testing
Describe the tests you ran to verify your changes. Please delete options that are not relevant.
Test Environment
Screenshots/Videos (Put "None" if there are no related issues)
None
Documentation
Please delete options that are not relevant.
Checklist (Don't delete any options)
Breaking Changes (Put "None" if there are no related issues)
None
Additional Notes (Put "None" if there are no related issues)
None
Summary by CodeRabbit
Chores
Bug Fixes