Conversation
## 実装内容 以下の作業を完了しました: ### 1. **lefthook.yml の作成** (lefthook.yml) Zennの記事を参考に、以下の機能を持つ設定ファイルを作成しました: - **pre-commitフック**: コミット前に自動実行 - **format コマンド**: `dart format`でコードを自動フォーマットし、変更をステージに追加 - **analyze コマンド**: `flutter analyze`で静的解析を実行 - **parallel: false**: 順序を保証するため、並列実行を無効化 ### 2. **lefthookのインストール** - `lefthook install` を実行し、Gitフックに登録完了 - pre-commitフックが正常に設定されました ### 3. **動作確認** - 静的解析が正常に動作することを確認 - 既存のanalysis_options.yamlの設定と互換性があることを確認 ## 使用方法 今後、Dartファイルをコミットする際: 1. `git add` でファイルをステージング 2. `git commit` を実行 3. 自動的に以下が実行されます: - コードフォーマット (dart format) - 静的解析 (flutter analyze) 4. エラーがなければコミットが完了 手動でフックを実行したい場合: ```bash lefthook run pre-commit ``` これで、コミット時に自動的にコードの品質が保証されるようになりました!
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds a Lefthook configuration file for Dart project pre-commit hooks. Configures parallel execution to false and defines two commands: one to format staged Dart files using Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
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 f5138a8): https://animeishi-73560--pr166-vk-b05b-left-hook-10-ic29kdr1.web.app (expires Wed, 04 Feb 2026 14:20:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f1f494a67df8ccbb2232f73b6ccab4934a51e505 |
GitHub issue #107: https://zenn.dev/10_tofu_01/articles/flutter_formatter_linter_lefthook
せめてformatterだけでもしておくと楽そう
ラベル: 子issue
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.