Skip to content

chore: add CodeRabbit configuration#71

Merged
valbeat merged 1 commit into
mainfrom
chore/add-coderabbit-config
May 17, 2026
Merged

chore: add CodeRabbit configuration#71
valbeat merged 1 commit into
mainfrom
chore/add-coderabbit-config

Conversation

@valbeat
Copy link
Copy Markdown
Owner

@valbeat valbeat commented May 17, 2026

Summary

  • .coderabbit.yaml をプロジェクトルートに追加し、CodeRabbit によるレビューを有効化
  • 日本語レビュー (language: ja)、assertive プロファイル、main 向け PR の auto review を設定
  • src/ (PHP 8.4 / Result 型不変条件)、tests/ (t-wada 流 TDD)、*.md.github/workflows/ に path 別の指示を付与
  • PHPStan / actionlint / gitleaks / markdownlint / yamllint / languagetool を有効化

Test plan

  • PR 作成後、CodeRabbit bot がコメントを残すこと
  • レビューが日本語で返ってくること
  • vendor/ 配下や .phpstan/ などのキャッシュがレビュー対象外であること

Summary by CodeRabbit

  • Chores
    • Updated automated code review configuration to enhance development workflow with Japanese-language linting, security scanning, and code quality checks.

Review Change Stack

Configure CodeRabbit for Japanese reviews with PHP 8.4 / Result 型を
意識した path 別レビュー指示と PHPStan・actionlint 等の連携を追加。
@valbeat valbeat self-assigned this May 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Caution

Review failed

The pull request is closed.

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92e630a7-45a4-4adc-968f-2f652f22f0c4

📥 Commits

Reviewing files that changed from the base of the PR and between 7b9430d and c57d19d.

📒 Files selected for processing (1)
  • .coderabbit.yaml

📝 Walkthrough

Walkthrough

Added .coderabbit.yaml to configure CodeRabbit's automated review behavior with Japanese-language guidance, assertive review profile, auto-review enablement, path-specific code review instructions for PHP/tests/docs/workflows, excluded paths (vendor, caches), and enabled static analysis tools (phpstan, gitleaks, languagetool, markdownlint, yamllint, actionlint).

Changes

CodeRabbit Review Configuration

Layer / File(s) Summary
Review behavior and scope control
.coderabbit.yaml
Global review settings specify Japanese language and assertive tone, review display options (status, walkthrough, poem generation), auto-review enablement for non-draft PRs, target base branches, and path filters excluding vendor and cache directories from automated review scope.
Review guidelines and analysis tools
.coderabbit.yaml
Path-specific instructions define expectations for PHP source code (PHP 8.4+, Result type design invariants, exception propagation), tests (fixtures and test patterns), Markdown documentation (consistency with implementation, README accuracy), and GitHub workflows (pinned SHAs, secrets handling). Static analysis tools (phpstan, gitleaks, languagetool, markdownlint, yamllint, actionlint) are enabled while phpmd is disabled. Chat auto-reply is activated.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 A config file hops into view,
Telling CodeRabbit what to do—
Review in Japanese, clear and bright,
With tools aligned and standards tight! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-coderabbit-config

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.

@valbeat valbeat marked this pull request as ready for review May 17, 2026 11:35
Copilot AI review requested due to automatic review settings May 17, 2026 11:35
@valbeat valbeat merged commit 3336b44 into main May 17, 2026
4 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7b9430d) to head (c57d19d).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #71   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        40        40           
===========================================
  Files              2         2           
  Lines             80        80           
===========================================
  Hits              80        80           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a .coderabbit.yaml configuration file to standardize AI code reviews for a PHP project, emphasizing PHP 8.4 syntax, Rust-inspired Result types, and TDD practices. The review feedback suggests refining the instructions to specify that readonly and final modifiers apply to classes to prevent AI hallucinations on interfaces, prioritizing SHA-1 hashes for GitHub Actions security, and configuring LanguageTool to respect path filters to minimize noise.

Comment thread .coderabbit.yaml
- PHP 8.4 以上の構文・機能を前提にレビューする。
- Rust の Result<T, E> に倣った API 設計を尊重し、Ok / Err / Result の不変条件を崩していないか確認する。
- 例外による暗黙のエラー伝播ではなく、Result 型での明示的なエラーハンドリングを推奨する。
- readonly / final / 型宣言(戻り値・引数・プロパティ)の徹底をチェックする。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

readonlyfinal はクラスにのみ適用可能な修飾子です。src/ 配下には Result.php インターフェースが含まれているため、AI がインターフェースに対してもこれらの適用を求めてしまう誤検知(ハルシネーション)を防ぐため、「クラスにおける」という限定を加えることを推奨します。

        - クラスにおける readonly / final の適用、および型宣言(戻り値・引数・プロパティ)の徹底をチェックする。

Comment thread .coderabbit.yaml
- README の API 説明と src の実装が一致しているかを確認する。
- path: ".github/workflows/**"
instructions: |
- 使用するアクションはバージョンを固定(SHA か明示的なタグ)しているかを確認する。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

GitHub Actions のセキュリティベストプラクティスでは、アクションの参照にはタグ(v4 など)ではなく、不変な SHA-1 ハッシュを使用することが推奨されます。現在の記述でも SHA に言及されていますが、優先順位を明確にすることで、よりセキュアなレビュー結果を得やすくなります。

        - 使用するアクションはバージョンを固定(セキュリティ確保のため可能な限り SHA、困難な場合は明示的なタグ)しているかを確認する。

Comment thread .coderabbit.yaml
timeout_ms: 90000
languagetool:
enabled: true
enabled_only: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

enabled_only: false の場合、path_filters で除外したファイル(キャッシュファイルやロックファイルなど)に対しても LanguageTool が実行される可能性があります。他のツールとの整合性を保ち、不要なノイズを避けるため、true に設定してフィルターを尊重させることを推奨します。

      enabled_only: true

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

CodeRabbit による自動レビューを有効化するため、プロジェクトルートに設定ファイル .coderabbit.yaml を追加する PR です。レビュー言語やレビュー方針、パス別の指示、利用する静的解析/リンタ系ツールをまとめて構成し、レビューの一貫性と自動化を強化します。

Changes:

  • .coderabbit.yaml を追加し、日本語レビュー・assertive プロファイル・main 向け PR の auto review を設定
  • src/ / tests/ / *.md / .github/workflows/ に対して path 別のレビュー指示を追加
  • phpstan / actionlint / gitleaks / markdownlint / yamllint / languagetool 等のツール連携を有効化

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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