Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
コードレビュー自動化の最前線から
Search
Soutaro Matsumoto
March 25, 2018
Programming
19
9.9k
コードレビュー自動化の最前線から
Rails Developers Meetup 2018
https://railsdm.github.io/
Soutaro Matsumoto
March 25, 2018
Tweet
Share
More Decks by Soutaro Matsumoto
See All by Soutaro Matsumoto
Rubyの標準添付ライブラリを開発する
soutaro
2
150
Embedding it into Ruby code
soutaro
4
19k
Parsing RBS
soutaro
0
1.4k
Ruby programming with types in action
soutaro
4
870
IDE Development with Ruby
soutaro
4
1k
Ruby 3の新機能としての静的型検査の開発
soutaro
4
7.1k
An Introduction to Static Typing in Ruby 3
soutaro
3
390
The State of Ruby 3 Typing
soutaro
0
690
Ruby3 is a typed language
soutaro
0
360
Other Decks in Programming
See All in Programming
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
400
rails newと同時に型を書く
aki19035vc
5
690
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
2
1.6k
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
480
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
380
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
110
Package Traits
ikesyo
1
180
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
100
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
550
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
170
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
420
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
270
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
Code Review Best Practice
trishagee
65
17k
A designer walks into a library…
pauljervisheath
205
24k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Building Adaptive Systems
keathley
38
2.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
2
160
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Bash Introduction
62gerente
610
210k
Building Applications with DynamoDB
mza
92
6.2k
Transcript
ίʔυϨϏϡʔࣗಈԽͷ ࠷લઢ͔Β দຊफଠ !TPVUBSP
!TPVUBSP w দຊफଠ w 4JEF$*Λ։ൃ͍ͯ͠ΔʢޙͰ৮ΕΔʣ w 3VCZͷܕݕࠪثΛ࡞͍ͬͯΔʢࠓ৮Εͳ͍ʣ IUUQTHJUIVCDPNTPVUBSPTUFFQ
ίʔυϨϏϡʔ͍͠
None
ίʔυϨϏϡʔͷ͠͞ w ΊΜͲ͍͘͞ w ͕͔͔࣌ؒΔ w ਓؒؔ Ͱ͖Δ͚ͩػցʹΒ͍ͤͨ
ίʔυϨϏϡʔͱ w ͷ͋ΔίʔυΛݟ͚ͭͯमਖ਼͢ΔΑ͏ʹ͓ئ͍͢Δ w ιϑτΣΞΛϝϯςφϯε͍͢͠ঢ়ଶʹอͭ w ෆ۩߹Λݟ͚ͭΔ
ίʔυϨϏϡʔͷࣗಈԽ w ͳΜΒ͔ͷπʔϧͰɺΛൃݟͯ͠։ൃऀʹमਖ਼Λଅ͢ w ࣗಈϨϏϡʔͰશͯͷΛൃݟͰ͖ͳ͍ͷͰɺ࠷ऴత ʹਓ͕ؒ֬ೝ͢Δ w ͷ૯ྔมΘΒͳ͍͕ɺਓ͕ؒ֬ೝ͠ͳ͍ͱ͍͚ͳ ͍ͷྔ͕ݮΔ
ίʔυͷ w Ұൠతͳ w ෆదͳ໊લ w ׂ͕ඞཁͳίʔυ w ͗͢Δߦ w
ྑ͘ͳ͍நԽ w ϓϩδΣΫτݻ༗ͷ
ϓϩδΣΫτݻ༗ͷʢྫʣ
ϓϩδΣΫτݻ༗ͷʢྫʣ
ϓϩδΣΫτݻ༗ͷ w ҰൠతͳϕετϓϥΫςΟεͱҰக͠ͳ͍͠ɺໃ६͢Δ͜ ͱ͢Β͋Δ w ҰൠతͳͰͳ͍ͷͰɺϓϩδΣΫτʹؔ͘Θͬͯ ͍Δਓ͔͠Βͳ͍ w ద༻Ͱ͖Δൣғ͕ۃΊͯڱ͍
՝ w ։ൃΛԁʹਐΊΔͨΊͷϓϩδΣΫτݻ༗ͷϧʔϧɺ Ұൠతͳ-*/5πʔϧͰΧόʔͰ͖ͳ͍ w ϓϩδΣΫτͷʹͱͳͬͯେ͖ͳʹͳΔ w ৽͍͠ϝϯόʔ͕Ճೖͯ͠ཕΛ౿Ήճ͕૿͑Δ w Α͘Βͳ͍"1*ͷ͕૿͑Δ
ղܾํ๏ w 3VCP$PQʹ13͢Δ w 3VCP$PQͷϓϥάΠϯΛ࡞Δ
͍͍͍ w ҰൠతͳϓϩάϥϛϯάͷͰͳ͍ͷͰɺ13ͮ͠Β ͍ w ར༻ऀ͕ਓ͘Β͍͔͍͠ͳ͍ϓϥάΠϯͱ͔࡞Γͨ͘ͳ ͍͠ϝϯςφϯεͨ͘͠ͳ͍
3VCZϓϩάϥϛϯά͕͗͢͠Δ w ΄ͱΜͲͷ߹ಛఆͷ໊લͷࢀরΛݕग़Ͱ͖Εྑ͍ w ϓϩάϥϛϯά͠ͳ͍ͱղ͚ͳ͍Ͱͳ͍ͷʹɺ 3VCZͰॻ͘ͷແବͳίετ w ίετ͕ߴ͗͢ΔͷͰར༻ऀ͕ेʹଟ͘ͳ͍ͱ։ൃ ͍ͨ͠ؾ࣋ͪʹͳΒͳ͍
ղܾํ๏ w ؆୯ʹϧʔϧΛՃͰ͖Δ-*/5πʔϧΛ։ൃ͢Δ w ݕ͍ࠪͨ͜͠ͱࣗମ؆୯ͳͷͰɺখ͞ͳݴޠΛ࡞Δ ͜ͱͰ3VCZϓϩάϥϛϯά͠ͳͯ͘ରԠͰ͖Δ w ؆୯ʹϧʔϧ͕ՃͰ͖ΔͷͰΈΜͳϓϩδΣΫτຖ ʹϧʔϧΛ͡ΌΜ͡ΌΜՃ͢Δʢͣʣ
ਖ਼نදݱͱಉ͡ߏ w ਖ਼نදݱ੍ݶ͞Εͨϓϩάϥϛϯάݴޠ w จࣈྻ͕͋Δੑ࣭Λຬ͔ͨ͢Ͳ͏͔ΛݕࠪͰ͖Δ w ʮϝʔϧΞυϨεͬΆ͍ײ͔͡Ͳ͏͔ʯ w ͳΜͰͰ͖ΔΘ͚Ͱͳ͍͕ɺҰൠతͳϓϩάϥϛ ϯάݴޠΑΓ֮͑Δͷ͕؆୯
w ਖ਼نදݱͰࡁΉͳΒɺਖ਼نදݱͰࡁ·ͤΔํָ͕ͳ ͜ͱ͕ଟ͍
࡞ͬͨ $ gem install querly IUUQTHJUIVCDPNTPVUBSPRVFSMZ
rules: - id: com.sideci.env pattern: ENV message: | ڥมΛ͏ͱ͖ .env.sample
ʹ αϯϓϧΛೖΕ͍ͯͩ͘͞
rules: - id: com.sideci.env pattern: octokit() message: | octokit Ͱͳ͘ɺϦτϥΠͱ͔Λྑ͍ײ͡ʹ
ͬͯ͘ΕΔ with_octkit Λ͍·͠ΐ͏
ύλʔϯ w ҾΛ͏ϝιουݺͼग़͠ has_many(_, class_name: _, !inverse_of: _, ...) w
Ϩγʔόͷࢦఆ :string:.freeze() w ϒϩοΫͷ༗ແͷࢦఆ _.count() !{} w จ຺ save(!validate: false) [!conditional]
- id: com.sideci.link_to_with_method pattern: "link_to(..., method: _, ...)" message: |
GETҎ֎ΛϦϯΫͰ࣮͠ͳ͍Ͱ͍ͩ͘͞ formΛ͏͔ɺAjaxͰ໌ࣔతʹ࣮͠·͠ΐ͏ɻ
- id: com.sideci.with_octokit pattern: - "with_octokit(_)" message: with_octokit ༻ՄೳͳτʔΫϯΛ୳ͨ͢Ίɺ ͞ΕͨϒϩοΫΛϦτϥΠ͠·͢ɻ
ϒϩοΫϦτϥΠ͞Εͯྑ͍Α͏ʹͳ͍ͬͯ·͔͢ʁ justification: - ϒϩοΫ͕ϦτϥΠ͞Εͯͳ͍Α͏ʹ࣮͞Ε͍ͯΔ߹
- id: com.sideci.repository.full_name pattern: api_github_repository.full_name message: | GithubRepository#full_name Λ͍·͠ΐ͏ examples:
- before: repo.api_github_repository.full_name after: repo.full_name
- id: com.sideci.remove_column pattern: - 'remove_column(:symbol:, ...)' message: | ෳ߹ΠϯσοΫε͕ઃఆ͞Ε͍ͯΔΧϥϜΛআ͢Δࡍʹɺ
ઌʹΠϯσοΫεΛআ͢ΔΑ͏ʹ͍ͯͩ͘͠͞ examples: - before: "remove_column :organizations, :plan_id"
- 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)
- 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)Λ͏ํ͕ߴͰ͢ɻ
͍ಓ w มͳ"1*ͷ͍ํΛ͍ͯͨ͠ΒࣤΔ w ʮTBWFͨ͠ΒฦΓΛ֬ೝ͠Α͏ʯ w "1*Λ%FQSFDBUF͢Δ w ʮ0K͏Θͳ͍Α͏ʹ͠·͠ΐ͏ʯ w
"1*ʹؔ͢ΔิใΛग़͢ w DPVOUͱTJ[Fͷҧ͍ w ʮXJUI@PDUPLJUϦτϥΠ͢Δ͔ΒCMPDLͷத࠶࣮ߦ͞ ΕͯյΕͳ͍Α͏ʹͯ͠Ͷʯ
ʹཱͭͷʁ w গͳ͘ͱ4JEF$*ࣾͰ͍ͬͯΔ w ΈΜͳؾܰʹϧʔϧΛՃ͍ͯ͠Δ w 13ΛϨϏϡʔ͍ͯͯ͠܁Γฦ͠ʹؾ͍ͮͨΒ2VFSMZʹ Ճ͢Δ w 13Λ࡞͍ͬͯͯɺͳʹ͔Λ%FQSFDBUF͍ͨ͠ͱ͖ʹ
2VFSMZʹՃ͢Δ w ਫ਼ѱ͍͚Ͳɺؾʹ͠ͳ͍
ਫ਼͕ѱ͍ w ໊લͰϚονϯά͍ͯ͠Δ͚ͩͳͷͰɺGBMTFQPTJUJWF͕ଟ͍ ˠҙਤ͞ΕͨσβΠϯ w ϧʔϧΛؾܰʹՃͰ͖Δ͜ͱͷํ͕େ w ʮࡶʹϧʔϧΛՃͯ͠ɺࡶʹݕࠪ͢Δʯ w ϊΠζରࡦͦͷ্ͷϨΠϠͰؤுΔ
w 13Ͱมߋͨ͠ͱ͜Ζ͚ͩΛදࣔͯ͠ઈରΛݮΒ͢ w 044 SFWJFXEPH ͰΔ͔ɺۚͰԥΔ 4JEF$*
sideci.com
·ͱΊ w ϓϩδΣΫτݻ༗ͷϧʔϧΛؾܰʹՃͯ͠ɺίʔυϨ ϏϡʔΛޮԽ͠Α͏ w HFNJOTUBMMRVFSMZ w 2VFSMZΛ͏ͳΒ4JEF$*ʢ3VCP$PQ͑Δʂʣ w HFNΛ࡞Δͱ͖ʹ:PVUVCFSͱͷ໊લͷিಥʹҙ͢Δ