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
350
Other Decks in Programming
See All in Programming
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Outline View in SwiftUI
1024jp
1
320
Ethereum_.pdf
nekomatu
0
460
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Arm移行タイムアタック
qnighy
0
310
Quine, Polyglot, 良いコード
qnighy
4
640
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Designing for Performance
lara
604
68k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Why Our Code Smells
bkeepers
PRO
334
57k
Automating Front-end Workflow
addyosmani
1366
200k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Cult of Friendly URLs
andyhume
78
6k
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ͱͷ໊લͷিಥʹҙ͢Δ