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
rubocop-headquarters-2018.pdf
Search
Koichi ITO
July 14, 2018
Programming
3
5.8k
rubocop-headquarters-2018.pdf
Rails Developers Meetup 2018 Day 3 Extreme (
https://techplay.jp/event/679666
)
Koichi ITO
July 14, 2018
Tweet
Share
More Decks by Koichi ITO
See All by Koichi ITO
Bliki (ja), and the Cathedral, and the Bazaar
koic
8
2.1k
Welcome to the LLM Club
koic
0
310
RuboCop: Modularity and AST Insights
koic
3
4.7k
Carving the Way to Ruby Engineering
koic
3
1.1k
Beyond the RuboCop Defaults
koic
3
4.5k
Minify Ruby Code
koic
2
2.4k
Permanent Agility
koic
38
9.2k
RuboCop: LSP and Prism
koic
3
5.3k
Organizational Pattern Hatching
koic
0
1.5k
Other Decks in Programming
See All in Programming
Claude Code と OpenAI o3 で メタデータ情報を作る
laket
0
140
AWS Serverless Application Model入門_20250708
smatsuzaki
0
120
Honoアップデート 2025年夏
yusukebe
1
840
「リーダーは意思決定する人」って本当?~ 学びを現場で活かす、リーダー4ヶ月目の試行錯誤 ~
marina1017
0
240
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
970
Vibe coding コードレビュー
kinopeee
0
460
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
590
State of CSS 2025
benjaminkott
1
120
コンテキストエンジニアリング Cursor編
kinopeee
1
700
Portapad紹介プレゼンテーション
gotoumakakeru
1
130
SOCI Index Manifest v2が出たので調べてみた / Introduction to SOCI Index Manifest v2
tkikuc
1
100
Constant integer division faster than compiler-generated code
herumi
2
690
Featured
See All Featured
Music & Morning Musume
bryan
46
6.7k
Designing for Performance
lara
610
69k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Into the Great Unknown - MozCon
thekraken
40
2k
Automating Front-end Workflow
addyosmani
1370
200k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Art, The Web, and Tiny UX
lynnandtonic
302
21k
Docker and Python
trallard
45
3.5k
RailsConf 2023
tenderlove
30
1.2k
Transcript
4BU 3VCP$PQ )FBERVBSUFST 3BJMT%FWFMPQFST.FFUVQ%BZ&YUSFNF %3&$0.$P -UE The road to
RuboCop 1.0 after RubyKaigi 2018 ,PJDIJ*50FTN
!LPJD w 3VCP$PQDPNNJUUFS w "30SBDMFFOIBODFE BEBQUFSDPNNJUUFS w &JXB4ZTUFN .BOBHFNFOU *OD
!FTNJOD -VODI4QPOTPS )FSF
3BJMTENBOENF
3BJMTEN
3BJMTEN
3BJMTENEBZ
3BJMTENEBZ
None
None
None
3BJMTίϛϡχςΟҭͪͷࢹ
4BU 3VCP$PQ )FBERVBSUFST 3BJMT%FWFMPQFST.FFUVQ%BZ&YUSFNF %3&$0.$P -UE The road to
RuboCop 1.0 after RubyKaigi 2018 ,PJDIJ*50FTN
ࠓͷ
IUUQTTQFBLFSEFDLDPNLBLVUBOJBHJMFNBOJGFTUPEFDBEF TMJEF !LBLVUBOJ
w"CPVU3VCP$PQ)2 w5IFSPBEUP 3VCP$PQBGUFS 3VCZ,BJHJ "HFOEB
1FPQMF 1SPEVDU
1FPQMF
w ݄ʹདྷ͍ͯͨ͠ !CCBUTPWʹΑͬͯެ։͞ΕΔ w (JU)VC্ʹࢄ͍ͯͨ͠(BOH PG3VCP$PQΛ౷ׅ͍ͯ͠Δ (JU)VCPSHBOJ[BUJPO w "OFX044DPNNVOJUZ 3VCP$PQ)FBERVBSUFST
HJUIVCDPNSVCPDPQIR
None
w 3VCP$PQ$PSF w 3VCP$PQ1FSGPSNBODF w 3VCP$PQ3BJMT w 3VCP$PQ34QFD w 3VCZ4UZMF(VJEF
w 3BJMT4UZMF(VJEF w 3VCP$PQ+1 w FUD 3VCP$PQ)2ͷSFQP
w ࢄͨ͠ෳͷݸਓϦϙδτϦ͔Β ͍ͪίϛϡχςΟͷϦϙδτϦ w ݸਓϦϙδτϦͷਓ͕ͨͪ)2ʹू ·͖ͬͯͨ 044ίϛϡχςΟͷৢ
w 3VCP$PQ$PSFΛத৺ʹؔ৺ͷ͋ Δϝϯόʔɺ3VCP$PQ34QFDΛ த৺ʹ׆ಈ͍ͯ͠Δϝϯόʔ w ͯ͢ͷϦϙδτϦʹίϛοτݖ͕͋ ΔΘ͚Ͱͳ͍ w ྫ͑ࢲ$PSF1FSGPSNBODF 3BJMT+1
ϝϯόʔ͝ͱͷྖҬͷҧ͍
w $PSFCCBUTPWSVCPDPQͩͬ ͨͷͰɺ͍ΘΏΔ3VCP$PQͱݺ Ε͍ͯΔͷͷத৺ w 3VCP$PQ34QFDͳͲ֦ு$PQ͕ ґଘ͍ͯ͠Δ֦ுݩ(FNͷଆ໘ w $PSFͰܧঝʹؔ͢ΔΠϯλϑΣʔε ͕มΘΔͱ֦ு$PQӨڹΛड͚Δ
֦ுݩ$PQͱͯ͠ͷ$PSF
w ͜͜Ұͷഁյతมߋͱͯ͠ /PEF1BUUFSOͷOJM ͷมߋ 3VCP$PQ$PQ͔Βͷ 3BOHF)FMQϞδϡʔϧΓग़͠ ͕͋Δ ֤֦ு(FNਵ͕ඞཁ w
ؔ৺ͷ͋Δϝϯόʔ͕)2ʹू·ͬ ͨͷྑ͍ ҟͳΔϓϩδΣΫτؒͰͷಉظ
w ίϯτϦϏϡʔλʹൺͯΕΔ͜ ͱ͕૿͑Δ w ίϛολʔʹͳͬͯվΊͯࢥͬͨ͜ Ε·Ͱͱ͜Ε͔Β w (JU)VCϕʔεͷ3BJMTίϛϡχ ςΟͱൺֱ )2ઃཱͱಉ࣌ʹίϛολʔʹͳͬͨ
044ίϛϡχςΟʹΑΔҧ͍ SBJMTSBJMT CCBUTPWSVCPDPQ 3FWJFX ؔ৺Λ࣋ͬͨਓ ؔ৺Λ࣋ͬͨਓ $MPTF JTTVF *TTVFνʔϜɺίϛολʔɺί Ξϝϯόʔ
ίϛολʔ .FSHF13 ίϛολʔɺίΞϝϯόʔ ΄΅ϦϙδτϦΦʔφʔ NBTUFS QVTI ίϛολʔɺίΞϝϯόʔ ϦϙδτϦΦʔφʔͷΈ ؍ଌൣғ 3FMFBTF ϦϦʔεϚωʔδϟ ϦϙδτϦΦʔφʔ
ࢲ͕ۙະདྷʹඳ͘3VCP$PQ)2ͷੈք؍ SBJMTSBJMT SVCPDPQIRSVCPDPQ 3FWJFX ؔ৺Λ࣋ͬͨਓ ؔ৺Λ࣋ͬͨਓ $MPTF JTTVF *TTVFνʔϜɺίϛολʔɺί Ξϝϯόʔ
ίϛολʔ .FSHF13 ίϛολʔɺίΞϝϯόʔ ίϛολʔ NBTUFS QVTI ίϛολʔɺίΞϝϯόʔ ίϛολʔ 3FMFBTF ϦϦʔεϚωʔδϟ ϔουϝϯςφʔ 0S
SVCPDPQIRSVCPDPQ %SPQTVQQPSUGPS.3*
w HJUQVTIPSJHJONBTUFSʹͭ ͍ͯ w جຊ1VMM3FRVFTUΛ։͘ w ໌നͳ$PTNFUJDDIBOHF NBTUFSQVTIͰྑ͍ͷͰʁ ίϛολʔͷݖརͱن
None
w ͬͯΈͤ HJUQVTIPSJHJONBTUFS git push origin master
SVCPDPQIRSVCPDPQ!GGBF 'JY$)"/(-0(NE
None
None
IUUQTUXJUUFSDPNLPJDTUBUVT
w lNBTUFSQVTI͢Δͱ͖13Λ ૹΔͱ͖ΑΓ৻ॏʹ͍ͬͯΔz w l࣌ؒʹΘΕͯΔͱ͖Βͳ͍z w l ϛεͨ͋͠ͱ NBTUFSQVTIͷ จԽΛ࡞ΔͳΒઆ໌͏·͍͜ͱ͢
Δඞཁ͕͋Δz 3BJMTίϛολʔ͔Βͷॿݴ
None
None
͔͜͜Βগ͠ ৽ͨͳࢀೖͷώϯτ
ਓࡐ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&YUFOEDPQNFUBEBUB *OUSPEVDFOFXDPQTXJUIBTQFDJBMTUBUVT JOTUFBEPGFOBCMFEEJTBCMFE
*NQMFNFOUPQUJPOTUPSVOPOMZTBGFDPQT BOETBGFBVUPDPSSFDUT #JHNJMFTUPOFUP3VCP$PQ
SVCPDPQIRSVCPDPQ &YUSBDU3BJMT$PQTJOBTFQBSBUF
None
w 3VCP$PQࣗମϑϨʔϜϫʔΫ ϥΠϒϥϦϥϯλΠϜʹґଘͤͣ 3VCZʹϑΥʔΧε͍ͨ͠ w ࡞ऀͱͯ͠ɺ͍·3BJMTΛ͋·Γ ͍ͬͯͳ͍Β͍͠ w ͨͷ·Ε·ͨ͠ 5-%3
w SVCPDPQSBJMTͱ͍͏HFN طʹଘࡏ͍ͯ͠Δ ΤίγεςϜ্ͷ՝
None
None
w SBJMTSBJMTͷSVCPDPQZNMΛө͠ ͨSEQBSUZDPQ w 3VCZ,BJHJͰCCBUTPW͞Μʹ ZBIPOEB͞Μ͕Λͯ͘͠Εͨ w 3VCZ,BJHJޙʹ%SFONJ͞ΜΒ͔Βϝ ϯγϣϯ͕͋Δ w
13Λૹ͍ͬͯͨࢲʹҾ͖ܧ͗ ྲྀΕ
None
None
None
None
!UPTIJNBSV͞Μ͋Γ͕ͱ͏͍͟͝·͢ʂ
w 3VCP$PQͷ3BJMT෦ॺʹ͍ͭͯ ελϒʹͯ͠ɺSVCPDPQSBJMT HFNͷՃΛଅ͢ϩάΛग़ྗ͢Δ w ͋Δ͍3VCP$PQ3BJMTʹ ϑΥʔϧόοΫ͢Δ 3VCP$PQ3BJMTͷҠߦ
SVCPDPQIRSVCPDPQ &YUSBDU1FSGPSNBODF$PQTJOUPBTFQBSBUFHFN
None
w ύϑΥʔϚϯεޮʹ͍ͭͯ.3* ʹಛԽͨ͠༰ʹͳ͍ͬͯΔ w 3VCP$PQ+3VCZαϙʔτ ͍ͯ͠Δ w 3VCP$PQ$PSFͱͯ͠ॲཧܥ ʹґଘ͠ͳ͍ܗΛࢦ͍ͯ͠Δ 5-%3
None
w ࣮ࡍͷޮՌʹ͍ͭͯɺެࣜυΩϡ ϝϯτͷϦϑΝϨϯεʹه͞Ε͍ͯ Δ߹͕͋Δ w ࠾ΛΜͩ࣌Ұಡ͔ͯ͠Β࣮ߦ ΛࢼΈͯྑͦ͞͏ 5JQTPG1FSGPSNBODFDPQ
1FSGPSNBODF4BNQMF
+VBOJUP'BUBTGBTUSVCZ
SBJMTSBJMT
CFODINBSLJQT
$PNQBSJTPO % ruby -v shuffle-first-vs-sample.rb ruby 2.5.1p57 (2018-03-29 revision 63029)
[x86_64- darwin17] Warming up -------------------------------------- Array#shuffle.first 35.171k i/100ms Array#sample 229.945k i/100ms Calculating ------------------------------------- Array#shuffle.first 400.180k (± 5.9%) i/s - 2.005M in 5.026934s Array#sample 6.407M (± 6.4%) i/s - 31.962M in 5.010117s Comparison: Array#sample: 6407183.3 i/s Array#shuffle.first: 400180.2 i/s - 16.01x slower
w !DPNQPTFSJOUFSBMJB͕ਐΊͯ ͘Ε͍ͯΔ w 3VCP$PQʹ͚ͯ 3VCP$PQ3BJMTಉ༷ਐḿ͍ͯ͠Δ w ͠Β͘3VCP$PQ$PSFͱͷಉ ظ͕৬ਓͷԹ͔ͳख࡞ۀ 1FSGPSNBODFDPQTͷநग़ঢ়گ
SVCPDPQIRSVCPDPQ &YUFOEDPQNFUBEBUB
None
w ͓ͦΒ͘3VCP$PQͷۄ w 3VCP$PQΛΞοϓάϨʔυͨ͠ࡍʹ ރΕ͍ͯͳ͍$PQͰͷ͕͋ͬͨΓ CSFBLJOHDIBOHFͨ͠Γͷ൵͠Έ ͷ͓ศΓͷػೳ w SVCPDPQZNM EFGBVMUZNM
ͷ ϝλσʔλͷՃ 5-%3
w 7FSTJPO"EEFEʜ$PQ͕Ճ͞Εͨόʔδϣ ϯ w 7FSTJPO$IBOHFEʜϢʔβʔʹӨڹͷ͋Δόʔ δϣϯ ৽͍͠ઃఆɺσϑΥϧτͷมߋ w 7FSTJPO3FNPWFEʜআ͞Εͨόʔδϣϯ
w 4BGFʜِཅੑͳͲͳ͘ઃܭͲ͓Γʹ৴པͰ͖Δ w 4BGF"VUP$PSSFDUʜࣗಈमਖ਼ͰյΕ͍ͯͳ͍ ͭͷϝλσʔλ
w 4BGFΦϓγϣϯͷΈ࣮ߦ͢Δ w 4BGF"VUP$PSSFDUͷΈ࣮ߦ͢Δ w σϑΥϧτͰͯ͢4BGFѻ͍ w ࠷৽όʔδϣϯͷ$PQΛআ֎ͯ͠ ࣮ߦ͢Δ ࣮ߦΦϓγϣϯͷީิ
w 4BGFͱ4BGF"VUP$PSSFDUͷ ఆʹ͍ͭͯͲ͏͢Δ͔ w طଘΠγϡʔ͕͋Δ͔͕ͻͱͭͷࢦඪ ʹͳΓͦ͏ ެ։͞Εͨ۩ମతඪຊ w ͕͋Ε3VCP$PQ$PSF͔
3VCP$PQ+1·Ͱ͓ศΓΛ ݒ೦
w HPPEpSTUJTTVFͱͯ͠ਐΜͰ ͍Δ ঢ়گ
SVCPDPQIRSVCPDPQ *OUSPEVDFOFXDPQTXJUIBTQFDJBMTUBUVT JOTUFBEPGFOBCMFEEJTBCMFE
None
w طଘͷFOBCMFEEJTBCMFE ͷ֦ுͱղऍͰ͖Δ w ৽ͨʹ/FX ͋Δ͍OJM Λ༻ҙ ͯ͠ɺͦͷͷ߹৽ͨͳ$PQ Λ͏͔Ϣʔβʔʹ༗ޮແޮΛΏ ͩͶΔܯࠂΛදࣔ͢Δ
5-%3
w ΞοϓάϨʔυ࣌ʹʹͳΔͷރ Ε͍ͯͳ͍৽͍͠$PQͷέʔε͕ଟ ͍ ϦάϨογϣϯΑΓͪ͜Β͕ଟ͍ w ϝλσʔλͷ7FSTJPO"EEFEɺ͋ Δ͍&OBCMFEͷ/FXΛݩʹͯ͠ ࠷৽ͷόʔδϣϯͰՃ͞Εͨ$PQ
Λআ֎͢ΕޡݕΛݮΒͤͦ͏ *.0ΞοϓάϨʔυͷ҆৺ͷ্
w ݱঢ়ͷ3VCP$PQͰແޮʹ͍ͨ͠ $PQEnabled: falseͱͯ͠ ରॲͰ͖Δ͕ɺԿ͔ͷҙਤ͕͋ͬͯ EJTBCMFEʹͨ͠ͷ͔ɺόʔδϣ ϯΞοϓ࣌ͷރΕ͍ͯͳ͍$PQͩ ͔Βແޮʹ͍ͯ͠Δͷ͔ͷঢ়ଶ۠ผ ͕͔ͭͳ͍ ৽ͨͳϥϕϦϯά
SVCPDPQIRSVCPDPQ *NQMFNFOUPQUJPOTUPSVOPOMZTBGFDPQT BOETBGFBVUPDPSSFDUT
None
w SVCPDPQίϚϯυͷΦϓγϣ ϯΛՃ͢Δ 5-%3
w --safeΦϓγϣϯʜ4BGFͷ$PQ ͷΈ࣮ߦ͢Δ w --safe-auto-correctΦϓγϣϯʜ 4BGF"VUP$PSSFDUͷ$PQͷΈ࣮ߦ ͢Δ w ͜ΕΒΛSVCPDPQZNMͰઃఆͰ͖ ΔΑ͏ʹ͢Δ
৽ͨͳ࣮ߦΦϓγϣϯ
QPDLF *UIJOLUIBUUIPTFBSFUIFLFZQPJOUT*EPO`UXBOU VTUPIBWFTPNFIVHFSPBENBQGPS*XBOUVT UPIBWFTPNFUIJOHUIBUXFDBOBDUVBMMZSFBDIJOB GFXNPOUIT IUUQTCMPHTJEFDJDPNJOUFSWJFXXJUICP[IJEBSCBUTPWCCGEB $BOZPVUFMMVTUIFSPBENBQPG3VCP$PQJO NPSFEFUBJMT CCBUTPW *OUFSWJFXXJUI#P[IJEBS#BUTPW
1SFTFOUFECZ4JEFS5FBN
͓ΘΓʹ
w 3BJMTͱ1FSGPSNBODF$PSF͔ Β֎ΕΔ $PSFͷϝϯςφϯεੑ w 3VCP$PQϝλσʔλΛͬͯ ҆৺͕͓͚ͦ͏ͳ$PQͱͦ͏Ͱͳ͍ $PQΛ৭͚Δ ར༻ऀͷ҆શੑ
w ։ൃ͕͡·͔ͬͨΓͳͷͰ࠷৽ͷಈ ϦϙδτϦΛݟ͍ͯ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