リファクタリング Phase 1: イディオム・スタイル最新化#86
Conversation
- shard.yml: bump crystal requirement to >= 1.20.0 - lambda.cr: replace echo-subshell logging with stdlib Log, explicit block param - github/repository.cr: use HTTP::Status predicate methods, fix typos - github/models.cr: property -> getter, constant arrays + in?, presence - usecase/error: idiomatic || and backtrace? safe navigation - slack/models.cr: property -> getter, formatter refs #84 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase to use modern Crystal idioms, such as changing properties to getters, utilizing semantic HTTP status checks, and simplifying conditional logic. It also replaces shell execution in print_log with the standard Log library. The review feedback suggests further performance optimizations: using Tuple instead of Array for static constants (MENTION_REASONS and UPDATE_TYPES) to avoid heap allocations, and refactoring print_log to use index-based string slicing instead of each_char.each_slice to prevent intermediate array allocations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
de50b63 to
f704124
Compare
Part of #84(3分割 PR の 1/3)
最新の Crystal(1.20系)らしいイディオム・スタイルへ更新。挙動は不変。
shard.yml:crystal要件を>= 1.20.0にlambda.cr:puts `echo '...'`のサブシェルログ(インジェクション/クォート破壊リスク)を stdlibLogに置換。handlerのブロックパラメータを明示github/repository.cr: 数値比較をHTTP::Status述語(server_error?/unauthorized?/client_error?)へ。typo (retrun/faild) 修正github/models.cr:property→getter、冗長なemit_null: false削除、[...].includes?→定数配列+in?、comment_urlをpresence ||化error/usecase.cr:err.backtraceをbacktrace?.tryで安全にnotify/usecase.cr:size != 0→empty?否定slack/models.cr:property→getter検証:
crystal tool format --check差分なし /crystal build成功。🤖 Generated with Claude Code