chore(#148): FastAPIの型/スタイル規約をruff・mypy・CIで機械的に強制する - #214
Conversation
- ruff: FAST002 を有効化し、Annotated形式を今後も強制する - mypy: firebase_admin(型スタブ未配布)をignore_missing_imports、 types-nanoidを追加、list[Model]→list[Schema]の不変性エラーを Sequence化で解消、notification.pyの変数名衝突を解消 - ruff format による既存ファイルの整形差分を解消 - server/scripts/verify.sh を新規追加し、ruff check/format・mypy・ FastAPIのimport+OpenAPI生成スモークテストを一括実行できるようにする (DB起動不要でリファクタの回帰を検知できる) - CI (ci_server.yml) に verify.sh 実行ステップを追加。従来 uv sync の みでlint/型チェックが一切実行されていなかったギャップを埋める - .claude/rules/backend.md にAnnotated化・DI引数の並び順・検証方法を明文化 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 46 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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
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 |
|
Visit the preview URL for this PR (updated for commit 8d0c994): https://tabi-share-8ef6b--pr214-chore-fastapi-lint-m-al0lo0wh.web.app (expires Sat, 08 Aug 2026 01:29:23 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9f2a87ede127df7673322845e34cf22c1372d720 |
|
@coderabbitai approve |
|
@coderabbitai re-review |
|
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
概要
FastAPIの型/スタイル規約(Annotated形式)を ruff・mypy・CI で機械的に強制するハーネスを整備する。
詳細
FAST002を有効化し、今後Depends(...)等を旧形式で書くと自動検出されるようにする(refactor(#148): FastAPI の依存/パラメータを Annotated 形式に統一 #213 のAnnotated化を継続的に強制するハーネス)server/scripts/verify.shを新規追加してゲート化(ruff check / ruff format / mypy / FastAPI import+OpenAPI生成スモークを一括実行)ci_server.yml) は従来uv syncのみで lint/型チェックが一切実行されていなかったため、verify.sh実行ステップを追加.claude/rules/backend.mdに Annotated化・DI引数の並び順・検証方法のルールを明文化mypy修正の内訳:
firebase_admin: 型スタブ未配布のためignore_missing_importsを設定nanoid:types-nanoidを dev 依存に追加notification.py: ループ変数名の使い回し(RowMapping/dictでrを共用)をitemにリネームして解消trips.py/pages.py/blocks.pyの一覧取得系:list[Model]をlist[Schema]として返す不変性エラーを mypy 推奨のSequenceに変更して解消(response_modelがシリアライズを担うため実行時挙動は変化なし)Base ブランチは #213 です。#213 マージ後に develop へのdiffのみになります。
動作確認
server/scripts/verify.sh— 全項目 (ruff check / ruff format / mypy / smoke) パス確認項目
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com