-
Notifications
You must be signed in to change notification settings - Fork 3
docs: add FAQ section #94
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
Conversation
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.
Pull Request Overview
This PR adds a new FAQ section to the README documentation to help users understand the differences between cpp-linter-hooks
and mirrors-clang-format
. The FAQ section provides a comparison table highlighting the unique features and capabilities of each tool.
Key Changes
- Added FAQ section to table of contents
- Added comprehensive comparison table between
cpp-linter-hooks
andmirrors-clang-format
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #94 +/- ##
=======================================
Coverage 94.48% 94.48%
=======================================
Files 3 3
Lines 145 145
=======================================
Hits 137 137
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Warning Rate limit exceeded@shenxianpeng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 15 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe README.md file was updated to add a new FAQ section. This section contains a comparison table outlining the differences between Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
README.md
Outdated
| Feature | [`cpp-linter-hooks`](https://github.com/cpp-linter/cpp-linter-hooks) | [`mirrors-clang-format`](https://github.com/pre-commit/mirrors-clang-format) | | ||
|----------------------------------|:---------------------------------------------------------------------:|:----------------------------------------------------------------------------:| | ||
| Supports `clang-format` and `clang-tidy` | ✅ (`clang-format` & `clang-tidy`) | ✅ (`clang-format` only) | | ||
| Loads style configuration | ✅ via `--version` | ✅ (default behavior) | | ||
| Specify `clang-format` version | ✅ via `--version` | ✅ via `rev` | | ||
| Supports passing code string | ✅ via `--style` | ❌ | | ||
| Verbose output | ✅ via `--verbose` | ❌ | |
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.
🛠️ Refactor suggestion
Fix misleading feature descriptions in the comparison table.
-
Line 193 shows “Loads style configuration | ✅ via
--version
”.
The--version
flag selects the clang tool version, it does not load a style file.
Style configuration is picked up automatically when a.clang-format
file is present, or explicitly with--style=file
. -
Line 195 shows “Supports passing code string | ✅ via
--style
”.
--style
selects a formatting style; it is unrelated to feeding code via stdin.
If the intent is “formats code read from stdin (-
)”, spell that out explicitly.
Suggested fix:
-| Loads style configuration | ✅ via `--version` | ✅ (default behavior) |
+| Loads style configuration | ✅ via `--style=file` (or default `.clang-format`) | ✅ (default behavior) |
-| Supports passing code string | ✅ via `--style` | ❌ |
+| Supports formatting code from stdin | ✅ via `-` (stdin) | ❌ |
Correcting these cells prevents confusion for readers comparing the two hooks.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Feature | [`cpp-linter-hooks`](https://github.com/cpp-linter/cpp-linter-hooks) | [`mirrors-clang-format`](https://github.com/pre-commit/mirrors-clang-format) | | |
|----------------------------------|:---------------------------------------------------------------------:|:----------------------------------------------------------------------------:| | |
| Supports `clang-format` and `clang-tidy` | ✅ (`clang-format` & `clang-tidy`) | ✅ (`clang-format` only) | | |
| Loads style configuration | ✅ via `--version` | ✅ (default behavior) | | |
| Specify `clang-format` version | ✅ via `--version` | ✅ via `rev` | | |
| Supports passing code string | ✅ via `--style` | ❌ | | |
| Verbose output | ✅ via `--verbose` | ❌ | | |
| Feature | [`cpp-linter-hooks`](https://github.com/cpp-linter/cpp-linter-hooks) | [`mirrors-clang-format`](https://github.com/pre-commit/mirrors-clang-format) | | |
|----------------------------------|:---------------------------------------------------------------------:|:----------------------------------------------------------------------------:| | |
| Supports `clang-format` and `clang-tidy` | ✅ (`clang-format` & `clang-tidy`) | ✅ (`clang-format` only) | | |
| Loads style configuration | ✅ via `--style=file` (or default `.clang-format`) | ✅ (default behavior) | | |
| Specify `clang-format` version | ✅ via `--version` | ✅ via `rev` | | |
| Supports formatting code from stdin | ✅ via `-` (stdin) | ❌ | | |
| Verbose output | ✅ via `--verbose` | ❌ | |
🤖 Prompt for AI Agents
In README.md around lines 190 to 196, the feature descriptions in the comparison
table are misleading regarding style configuration loading and code string
passing. Update the "Loads style configuration" row to remove "via --version"
and clarify that style configuration is automatically loaded from a
.clang-format file or specified with --style=file. For the "Supports passing
code string" row, replace "via --style" with a clear statement that the tool
supports formatting code read from stdin (using -). This will accurately reflect
the features and avoid confusion.
Summary by CodeRabbit
cpp-linter-hooks
andmirrors-clang-format
.