-
Notifications
You must be signed in to change notification settings - Fork 1
Suggest code format #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughAdds explicit permissions and an ID to the clang-format check in the CI workflow and adds a follow-up step that uses parkerbxyz/suggest-changes to comment/request changes on PRs when formatting fails. Also applies a whitespace-only change in a C++ source file with no functional impact. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant PR as Pull Request
participant GH as GitHub Actions
participant Job as check-code-formatting
rect #E8F8F5
Dev->>PR: Open or update PR
PR->>GH: Trigger workflow
GH->>Job: Run formatting job (permissions set)
Job->>Job: Run clang-format step (id: clang-format)
end
alt Formatting passes
Job-->>PR: Report success
else Formatting fails
rect #FFF4E6
Job->>PR: Run suggest-changes action (post comment, REQUEST_CHANGES)
Job-->>PR: Report failure / changes requested
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please commit the suggested changes from clang-format.
| } | ||
| #endif | ||
| if (result.Error == Status::Ok) | ||
| if (result.Error == Status::Ok) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (result.Error == Status::Ok) | |
| if (result.Error == Status::Ok) |
There was a problem hiding this 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
🧹 Nitpick comments (1)
src/openrct2/actions/GameAction.cpp (1)
322-326: Fix formatting to satisfy clang-format (CI is red).Double spaces around the equality operator violate the style rule and cause the pipeline to fail.
Apply this diff:
- if (result.Error == Status::Ok) + if (result.Error == Status::Ok)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml(1 hunks)src/openrct2/actions/GameAction.cpp(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/openrct2/actions/GameAction.cpp
[error] 319-319: Code style issue: spacing around operator; 'result.Error == Status::Ok' should be 'result.Error == Status::Ok'.
🔇 Additional comments (1)
.github/workflows/ci.yml (1)
141-143: Nice: stable step id for referencing.Adding
id: clang_formatimproves readability and future conditionals.
Update permissions for actions for OpenRCT2#25211 . It needs to be done this way and *not* via token, because pull requests have no access to secrets. The default branch dictates what kind of access the default actions token has (constrained by repo config in https://github.com/OpenRCT2/OpenRCT2/settings/actions)
c7bcdd9 to
b75218d
Compare
Summary by CodeRabbit
Chores
Style