-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
have_fun: true | ||
code_review: | ||
disable: false | ||
comment_severity_threshold: MEDIUM | ||
max_review_comments: -1 | ||
pull_request_opened: | ||
help: false | ||
summary: true | ||
code_review: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# EQMonitor コーディングスタイルガイド | ||
|
||
このスタイルガイドは、EQMonitorプロジェクトのコードレビューにおいてGemini Code Assistが従うべきルールを定義します。 | ||
|
||
## 全般的なルール | ||
|
||
* **コードの明確さ**: コードは読みやすく、理解しやすいものであるべきです。 | ||
* **コメント**: 複雑なロジックや重要な決定には適切なコメントを付けてください。 | ||
* **命名規則**: 変数、関数、クラスの名前は目的を明確に示すものにしてください。 | ||
* **エラー処理**: 適切なエラー処理を行い、ユーザーに分かりやすいエラーメッセージを提供してください。 | ||
|
||
## Dartコーディング規約 | ||
|
||
* **Effective Dart**: Dartの公式ガイドライン「[Effective Dart](https://dart.dev/guides/language/effective-dart)」に従ってください。 | ||
* **フォーマット**: `dart format`を使用して一貫したフォーマットを維持してください。 | ||
* **Linting**: プロジェクトで定義されたlintルールに従ってください。 | ||
|
||
## Flutterベストプラクティス | ||
|
||
* **ウィジェット構造**: ウィジェットは小さく、再利用可能なコンポーネントに分割してください。 | ||
* **状態管理**: Riverpodを使用して状態管理を行ってください。 | ||
* **パフォーマンス**: 不必要な再ビルドを避け、パフォーマンスを最適化してください。 | ||
* **アクセシビリティ**: アプリはアクセシビリティに配慮したデザインにしてください。 | ||
|
||
## Riverpodの使用 | ||
|
||
* **Riverpod Generator**: 新しいProviderを作成する際は、Riverpod Generatorを使用してください。 | ||
* **Provider命名**: Providerの名前は明確で、その目的を示すものにしてください。 | ||
* **依存関係**: Providerの依存関係は明示的に定義し、循環依存を避けてください。 | ||
|
||
## テスト | ||
|
||
* **単体テスト**: 重要なロジックには単体テストを書いてください。 | ||
* **ウィジェットテスト**: UIコンポーネントにはウィジェットテストを書いてください。 | ||
* **テストカバレッジ**: 重要な機能については高いテストカバレッジを目指してください。 | ||
|
||
## セキュリティ | ||
|
||
* **データ保護**: ユーザーデータは適切に保護してください。 | ||
* **API通信**: セキュアな通信プロトコルを使用してください。 | ||
* **入力検証**: ユーザー入力は適切に検証してください。 | ||
|
||
## パフォーマンス | ||
|
||
* **メモリ使用量**: メモリリークを避け、効率的なメモリ使用を心がけてください。 | ||
* **バッテリー消費**: バックグラウンド処理は最小限に抑え、バッテリー消費を最適化してください。 | ||
* **レスポンシブ**: UIは常にレスポンシブであるべきです。メイン(UI)スレッドをブロックしないでください。 | ||
|
||
## プロジェクトディレクトリ構成 | ||
|
||
プロジェクトは以下のディレクトリ構成に従ってください: | ||
|
||
``` | ||
app/lib/ | ||
├── main.dart # アプリケーションのエントリーポイント | ||
├── app.dart # アプリケーションの初期化と設定 | ||
├── firebase_options.dart # Firebase設定 | ||
├── gen/ # 自動生成されたコード | ||
├── core/ # アプリケーション全体で使用される共通コンポーネント | ||
│ ├── api/ # API通信関連 | ||
│ ├── component/ # 共通UIコンポーネント | ||
│ ├── extension/ # 拡張メソッド | ||
│ ├── fcm/ # Firebase Cloud Messaging関連 | ||
│ ├── foundation/ # 基本的なユーティリティ | ||
│ ├── hook/ # カスタムフック | ||
│ ├── provider/ # グローバルプロバイダー | ||
│ │ ├── config/ # 設定関連プロバイダー | ||
│ │ ├── firebase/ # Firebase関連プロバイダー | ||
│ │ ├── jma_parameter/ # 気象庁パラメータ関連プロバイダー | ||
│ │ ├── log/ # ロギング関連プロバイダー | ||
│ │ ├── map/ # マップ関連プロバイダー | ||
│ │ ├── ntp/ # NTP(時刻同期)関連プロバイダー | ||
│ │ ├── websocket/ # WebSocket通信関連プロバイダー | ||
│ │ └── ... # その他のプロバイダー | ||
│ ├── router/ # ルーティング関連 | ||
│ ├── theme/ # テーマ設定 | ||
│ ├── util/ # ユーティリティ関数 | ||
│ └── utils/ # その他のユーティリティ | ||
└── feature/ # 機能別モジュール | ||
├── donation/ # 寄付機能 | ||
├── earthquake_history/ # 地震履歴機能 | ||
├── earthquake_history_details/ # 地震履歴詳細機能 | ||
├── earthquake_history_early/ # 地震速報履歴機能 | ||
├── earthquake_replay/ # 地震再生機能 | ||
├── eew/ # 緊急地震速報機能 | ||
├── home/ # ホーム画面機能 | ||
│ ├── component/ # ホーム画面のUIコンポーネント | ||
│ ├── data/ # ホーム画面のデータモデル | ||
│ └── page/ # ホーム画面のページ | ||
├── information_history/ # 情報履歴機能 | ||
├── information_history_details/ # 情報履歴詳細機能 | ||
├── kyoshin_monitor/ # 強震モニタ機能 | ||
├── location/ # 位置情報機能 | ||
├── map/ # マップ機能 | ||
├── settings/ # 設定機能 | ||
├── setup/ # 初期設定機能 | ||
├── shake_detection/ # 揺れ検知機能 | ||
└── talker/ # ログ表示機能 | ||
``` | ||
|
||
## 機能モジュールの構成 | ||
|
||
各機能モジュール(`feature/`以下のディレクトリ)は以下の構成に従ってください: | ||
|
||
``` | ||
feature/example/ | ||
├── component/ # UIコンポーネント | ||
├── data/ # データモデル、リポジトリ | ||
├── page/ # 画面 | ||
│ ├── example_page.dart # ページウィジェット | ||
│ └── example_view_model.dart # ビューモデル | ||
└── provider/ # 機能固有のプロバイダー | ||
``` |