Conversation
Allow users to specify a target language (e.g. --translate Japanese) so the LLM writes each finding's message in the requested language. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changes--translate オプションの追加
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/slidict/llm/client.rb`:
- Around line 96-99: The translate instruction in lint_prompt_for allows the
model to localize fields beyond message, which can alter severity values and
other fixed keys. Update lint_prompt_for so the translate guidance explicitly
limits translation to message only, while keeping slide, severity, and all field
names unchanged; refer to lint_prompt_for and normalize_severity when making the
prompt wording safer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 00bb220c-fe49-459a-8fe5-513bbdef9055
📒 Files selected for processing (6)
lib/slidict/cli/lint.rblib/slidict/lint/linter.rblib/slidict/llm/client.rbspec/slidict/cli/lint_spec.rbspec/slidict/lint/linter_spec.rbspec/slidict/llm/client_spec.rb
| def lint_prompt_for(slide_texts, translate: nil) | ||
| numbered = slide_texts.each_with_index.map { |text, i| "--- Slide #{i + 1} ---\n#{text}" }.join("\n\n") | ||
| format(LINT_PROMPT_TEMPLATE, numbered: numbered) | ||
| prompt = format(LINT_PROMPT_TEMPLATE, numbered: numbered) | ||
| translate ? "#{prompt}\nWrite each message field in #{translate}." : prompt |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
severity の契約まで翻訳される余地があります。
Line 99 の指示だと、モデルが message 以外の文字列値までローカライズする余地が残ります。ここで "warning" / "info" が翻訳されると、normalize_severity 側で未知の値がすべて "info" に丸められ、警告が静かに弱まります。message だけを翻訳し、キー・slide・severity は固定のままにする文面へ寄せたほうが安全です。
修正案
def lint_prompt_for(slide_texts, translate: nil)
numbered = slide_texts.each_with_index.map { |text, i| "--- Slide #{i + 1} ---\n#{text}" }.join("\n\n")
prompt = format(LINT_PROMPT_TEMPLATE, numbered: numbered)
- translate ? "#{prompt}\nWrite each message field in #{translate}." : prompt
+ return prompt unless translate
+
+ [
+ prompt,
+ %(Translate only the value of each "message" field into #{translate}.),
+ %(Keep the JSON keys, slide numbers, and severity values exactly as specified above.)
+ ].join("\n")
end📝 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.
| def lint_prompt_for(slide_texts, translate: nil) | |
| numbered = slide_texts.each_with_index.map { |text, i| "--- Slide #{i + 1} ---\n#{text}" }.join("\n\n") | |
| format(LINT_PROMPT_TEMPLATE, numbered: numbered) | |
| prompt = format(LINT_PROMPT_TEMPLATE, numbered: numbered) | |
| translate ? "#{prompt}\nWrite each message field in #{translate}." : prompt | |
| def lint_prompt_for(slide_texts, translate: nil) | |
| numbered = slide_texts.each_with_index.map { |text, i| "--- Slide #{i + 1} ---\n#{text}" }.join("\n\n") | |
| prompt = format(LINT_PROMPT_TEMPLATE, numbered: numbered) | |
| return prompt unless translate | |
| [ | |
| prompt, | |
| %(Translate only the value of each "message" field into #{translate}.), | |
| %(Keep the JSON keys, slide numbers, and severity values exactly as specified above.) | |
| ].join("\n") | |
| end |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@lib/slidict/llm/client.rb` around lines 96 - 99, The translate instruction in
lint_prompt_for allows the model to localize fields beyond message, which can
alter severity values and other fixed keys. Update lint_prompt_for so the
translate guidance explicitly limits translation to message only, while keeping
slide, severity, and all field names unchanged; refer to lint_prompt_for and
normalize_severity when making the prompt wording safer.
Allow users to specify a target language (e.g. --translate Japanese)
so the LLM writes each finding's message in the requested language.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Summary by CodeRabbit
新機能
slidict lintに翻訳オプションを追加し、結果を指定言語で表示できるようになりました。--translateの説明が追加されました。改善