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
130
Embedding it into Ruby code
soutaro
4
17k
Parsing RBS
soutaro
0
1.4k
Ruby programming with types in action
soutaro
4
850
IDE Development with Ruby
soutaro
4
1k
Ruby 3の新機能としての静的型検査の開発
soutaro
4
7k
An Introduction to Static Typing in Ruby 3
soutaro
3
370
The State of Ruby 3 Typing
soutaro
0
680
Ruby3 is a typed language
soutaro
0
340
Other Decks in Programming
See All in Programming
C++でシェーダを書く
fadis
6
4k
Amazon Qを使ってIaCを触ろう!
maruto
0
380
Quine, Polyglot, 良いコード
qnighy
4
630
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.2k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.2k
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
200
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
310
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
120
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
320
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
4
800
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
150
Click-free releases & the making of a CLI app
oheyadam
2
110
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
830
Designing for humans not robots
tammielis
250
25k
A designer walks into a library…
pauljervisheath
202
24k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
A better future with KSS
kneath
238
17k
Side Projects
sachag
452
42k
Teambox: Starting and Learning
jrom
133
8.8k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Code Review Best Practice
trishagee
64
17k
Facilitating Awesome Meetings
lara
50
6.1k
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ͱͷ໊લͷিಥʹҙ͢Δ