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
140
Embedding it into Ruby code
soutaro
4
18k
Parsing RBS
soutaro
0
1.4k
Ruby programming with types in action
soutaro
4
860
IDE Development with Ruby
soutaro
4
1k
Ruby 3の新機能としての静的型検査の開発
soutaro
4
7.1k
An Introduction to Static Typing in Ruby 3
soutaro
3
380
The State of Ruby 3 Typing
soutaro
0
680
Ruby3 is a typed language
soutaro
0
350
Other Decks in Programming
See All in Programming
42 best practices for Symfony, a decade later
tucksaun
1
180
testcontainers のススメ
sgash708
1
120
事業成長を爆速で進めてきたプロダクトエンジニアたちの成功談・失敗談
nealle
3
1.4k
103 Early Hints
sugi_0000
1
220
快速入門可觀測性
blueswen
0
320
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Jakarta EE meets AI
ivargrimstad
0
230
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
730
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Why Our Code Smells
bkeepers
PRO
335
57k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building Applications with DynamoDB
mza
91
6.1k
Bash Introduction
62gerente
608
210k
How to Ace a Technical Interview
jacobian
276
23k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Making the Leap to Tech Lead
cromwellryan
133
9k
Designing for Performance
lara
604
68k
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ͱͷ໊લͷিಥʹҙ͢Δ