Upgrade to Pro — share decks privately, control downloads, hide ads and more …

コードレビュー自動化の最前線から

 コードレビュー自動化の最前線から

Rails Developers Meetup 2018 https://railsdm.github.io/

Soutaro Matsumoto

March 25, 2018
Tweet

More Decks by Soutaro Matsumoto

Other Decks in Programming

Transcript

  1. ύλʔϯ w Ҿ਺Λ൐͏ϝιουݺͼग़͠
 has_many(_, class_name: _, !inverse_of: _, ...) w

    Ϩγʔόͷࢦఆ
 :string:.freeze() w ϒϩοΫͷ༗ແͷࢦఆ
 _.count() !{} w จ຺
 save(!validate: false) [!conditional]
  2. - id: com.sideci.link_to_with_method pattern: "link_to(..., method: _, ...)" message: |

    GETҎ֎ΛϦϯΫͰ࣮૷͠ͳ͍Ͱ͍ͩ͘͞ formΛ࢖͏͔ɺAjaxͰ໌ࣔతʹ࣮૷͠·͠ΐ͏ɻ
  3. - id: com.sideci.with_octokit pattern: - "with_octokit(_)" message: with_octokit ͸࢖༻ՄೳͳτʔΫϯΛ୳ͨ͢Ίɺ
 ౉͞ΕͨϒϩοΫΛϦτϥΠ͠·͢ɻ


    ϒϩοΫ͸ϦτϥΠ͞Εͯ΋ྑ͍Α͏ʹͳ͍ͬͯ·͔͢ʁ justification: - ϒϩοΫ͕ϦτϥΠ͞Εͯ΋໰୊ͳ͍Α͏ʹ࣮૷͞Ε͍ͯΔ৔߹
  4. - id: com.sideci.remove_column pattern: - 'remove_column(:symbol:, ...)' message: | ෳ߹ΠϯσοΫε͕ઃఆ͞Ε͍ͯΔΧϥϜΛ࡟আ͢Δࡍʹ͸ɺ


    ઌʹΠϯσοΫεΛ࡟আ͢ΔΑ͏ʹ͍ͯͩ͘͠͞ examples: - before:
 "remove_column :organizations, :plan_id"
  5. - id: com.sideci.pusher pattern: Pusher.trigger message: | Pusher.triggerΛ௚઀࢖͏ͷΛ΍Ί·͠ΐ͏ `PusherNotification` ʹΠϕϯτΛఆٛͯ͠࢖͍·͠ΐ͏ɻ

    `PusherNotification.trigger` ͸ΤϥʔॲཧΛؚΜͰ͍·͢ɻ examples: - before:
 Pusher.trigger("#{user.id}", "reload-dashboard", {}) after: PusherNotification.new_repository_added(user)
  6. - id: com.sideci.use_pluck pattern: "all.map(&:symbol:)" examples: - before: "Tool.all.map(&:id)" after:

    "Tool.pluck(:id)" message: |
 ActiveRecordͰ͸all.map(&:id)Λ͢ΔΑΓ
 pluck(:id)Λ࢖͏ํ͕ߴ଎Ͱ͢ɻ
  7. ࢖͍ಓ w มͳ"1*ͷ࢖͍ํΛ͍ͯͨ͠ΒࣤΔ w ʮTBWFͨ͠ΒฦΓ஋Λ֬ೝ͠Α͏ʯ w "1*Λ%FQSFDBUF͢Δ w ʮ0K͸΋͏࢖Θͳ͍Α͏ʹ͠·͠ΐ͏ʯ w

    "1*ʹؔ͢Δิ଍৘ใΛग़͢ w DPVOUͱTJ[Fͷҧ͍ w ʮXJUI@PDUPLJU͸ϦτϥΠ͢Δ͔ΒCMPDLͷத਎͸࠶࣮ߦ͞ Εͯ΋յΕͳ͍Α͏ʹͯ͠Ͷʯ