Slide 1

Slide 1 text

.BLF3VCP$PQ 4VQFS'BTU ,PJDIJ*50&4. *OD 3VCZ,BJHJ RuboCop server mode 5IV

Slide 2

Slide 2 text

!LPJD w 044QSPHSBNNFS w 3VCP$PQDPSFUFBN TJODF w )FBENBJOUBJOFSPG3VCP$PQ3BJMT 3VCP$PQ1FSGPSNBODF BOE 3VCP$PQ.JOJUFTU w &OHJOFFSJOH.BOBHFSBOE %JTUJOHVJTIFE&OHJOFFSPG&4. *OD

Slide 3

Slide 3 text

&4. *OD

Slide 4

Slide 4 text

🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊 *TFFCJ4QPOTPS #esm_ise_ebi #rubykaigi

Slide 5

Slide 5 text

Support OSS community

Slide 6

Slide 6 text

4QFBLFSTGSPN&4. *OD 👈%BZ SVCZLBJHJ# %BZ👉 SVCZLBJHJ# 👈%BZ SVCZLBJHJ#

Slide 7

Slide 7 text

+PJOVT 🗾w-FUTHSPXUPHFUIFS w:PVDBOXPSL SFNPUFMZGSPNBMM PWFS+BQBO w4FFBHJMFFTNDPKQ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

w +BWB4DSJQU1SFUUJFS &4-JOU w (P(PGNU w 3VTU3VTUGNU $MJQQZ w 3VCZ3VCP$PQ 4UBOEBSE BOE PUIFST -JOUFS'PSNBUUFS

Slide 11

Slide 11 text

IUUQTSBJMTIPTUJOHDPNXIJDISVCZHFNTEPZPVMPWF

Slide 12

Slide 12 text

IUUQTSBJMTIPTUJOHDPNXIJDISVCZHFNTGSVTUSBUFZPVUIFNPTU

Slide 13

Slide 13 text

3VCP$PQDPSFEFWFMPQFST +0900 UTC+0200 +0300 +0800 -0400 .PSFUIBODPOUSJCVUPST

Slide 14

Slide 14 text

3VCP$PQDPSFEFWFMPQFST +0900 UTC+0200 +0300 +0800 -0400 .PSFUIBODPOUSJCVUPST "VUIPS

Slide 15

Slide 15 text

5IFpSTUDPNNJU % git log -p --reverse commit afbead34db54506c12a21dbd4ce04fada0f8b9a4 Author: Bozhidar Batsov Date: Sat Apr 21 13:06:42 2012 +0300 Initial commit to rubocop. --- .document | 5 +++++ .gitignore | 49 +++++++++++++++++++++++++++++++++++++++ ++++++++++ .rspec | 1 + Gemfile | 16 ++++++++++++++++ LICENSE.txt | 20 ++++++++++++++++++++ README.rdoc | 19 +++++++++++++++++++ Rakefile | 45 +++++++++++++++++++++++++++++++++++++++ ++++++ features/rubocop.feature | 9 +++++++++ features/step_definitions/rubocop_steps.rb | 0 features/support/env.rb | 13 +++++++++++++

Slide 16

Slide 16 text

5IFpSTUDPNNJU % git log -p --reverse commit afbead34db54506c12a21dbd4ce04fada0f8b9a4 Author: Bozhidar Batsov Date: Sat Apr 21 13:06:42 2012 +0300 Initial commit to rubocop. --- .document | 5 +++++ .gitignore | 49 +++++++++++++++++++++++++++++++++++++++ ++++++++++ .rspec | 1 + Gemfile | 16 ++++++++++++++++ LICENSE.txt | 20 ++++++++++++++++++++ README.rdoc | 19 +++++++++++++++++++ Rakefile | 45 +++++++++++++++++++++++++++++++++++++++ ++++++ features/rubocop.feature | 9 +++++++++ features/step_definitions/rubocop_steps.rb | 0 features/support/env.rb | 13 +++++++++++++ 👈

Slide 17

Slide 17 text

UI"OOJWFSTBSZZFBS🎉

Slide 18

Slide 18 text

3VCP$PQDPSFEFWFMPQFST +0900 UTC+0200 +0300 +0800 -0400 .PSFUIBODPOUSJCVUPSTJOZFBST .F

Slide 19

Slide 19 text

.F

Slide 20

Slide 20 text

.BJOUBJO3VCP$PQ)2&WFSZ%BZ IUUQTHJUIVCDPNLPJD PSHSVCPDPQ

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

5IJTUBMLFYQMBJOT POFPGUIFNJMFTUPOFTPG3VCP$PQ

Slide 23

Slide 23 text

w5BHMJOFPG3VCP$PQMJLF 3VCZY w*OPUIFSXPSET 3VCP$PQ BJNTUPCFUXJDFBTGBTUBT 3VCP$PQ 3VCP$PQY

Slide 24

Slide 24 text

(SPXJOHOFFEGPS EFWFMPQFSFYQFSJFODF

Slide 25

Slide 25 text

w"QBSUPGMPDBMCVJMEQSPDFTT w$POUJOVPVT*OUFHSBUJPO w*OUFHSBUJPOBOEJOUFSBDUJPO XJUIFEJUPST*%&T QSPNJOFOUSFDFOUMZ 6TFDBTFTPG3VCP$PQ

Slide 26

Slide 26 text

/PPOFDPNQMBJOTBCPVU CFUUFSQFSGPSNBODF💨

Slide 27

Slide 27 text

$BDIJOH .VMUJDPSFT 3FEVDFVOVTFESFRVJSFT %BFNPOJ[F )PXUPNBLFJUGBTUFS

Slide 28

Slide 28 text

w*UIBWFCFFOQSPWJEFEGPSBMPOHUJNF w4UPSFEJOUP~/.cache/rubocop_cache CZEFGBVMU w4QFDJGZcache=falseJGZPVXBOUUP EJTBCMFUIFDBDIF $BDIJOH

Slide 29

Slide 29 text

w3VCP$PQSVOTQBSBMMFM JOTQFDUJPOCZEFGBVMU w3VCP$PQDBOSVO QBSBMMFMBVUPDPSSFDUJPO .VMUJDPSFT /&8

Slide 30

Slide 30 text

DPSF$16T)ZQFS5ISFBEJOH TFD OPQBSBMMFM QBSBMMFM w8IFO3VCP$PQ JOTQFDUTBMPUPG pMFT JUXJMMCF FGGFDUJWF wFHTFDTFD BCPVUpMFT

Slide 31

Slide 31 text

w"MMDPQTBSFMPBEFEFWFOXJUI UIF--onlyPQUJPO w/PUJNQMFNFOUFEZFUEVFUP MBSHFJOUFSOBMDIBOHFT 5#% w1BSUJBMMZSFMBUFEUPTFSWFSNPEF 3FEVDFVOVTFESFRVJSFT

Slide 32

Slide 32 text

w8F3VCP$PQEFWFMPQFSTXFSF BXBSFPGUIFDPTUPGJOJUJBM NPEVMFMPBEJOH w*JOUFHSBUFESVCPDPQEBFNPO JOUP3VCP$PQDPSF %BFNPOJ[F TFSWFSNPEF

Slide 33

Slide 33 text

YGBTUFSNPEVMFMPBEJOH TFD SFRVJSFSVCPDPQ SFRVJSFSVCPDPQTFSWFS wrequire 'rubocop' SFRVJSFTNPTUPGpMFT wrequire 'rubocop/ server'POMZSFRVJSFT pMFTOFFEFEGPS TFSWFSNPEF

Slide 34

Slide 34 text

%JWFJOUPUIFTFSWFSNPEF UPEBZ

Slide 35

Slide 35 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 36

Slide 36 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 37

Slide 37 text

#FGPSFSVCPDPQEBFNPO JOUFHSBUJPO 1BTUBOEDVSSFOU

Slide 38

Slide 38 text

*OTJEFUSBEJUJPOBMrubocopDPNNBOE 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run •RuboCop::CLI.new.runJTBOFOEQPJOU"1* w&BDICPPUrubocopQSPDFTTSVOTSVCPDPQDPNNBOE # Term #1 % rubocop 4UBSUBOESVO

Slide 39

Slide 39 text

3VCP$PQQSPDFTT 1*% *OTJEFUSBEJUJPOBMrubocopDPNNBOE # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run •RuboCop::CLI.new.runJTBOFOEQPJOU"1* w&BDICPPUrubocopQSPDFTTSVOTSVCPDPQDPNNBOE # Term #1 % rubocop # Term #2 % rubocop 4UBSUBOESVO 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run 4UBSUBOESVO

Slide 40

Slide 40 text

3VCP$PQQSPDFTT 1*% *OTJEFUSBEJUJPOBMrubocopDPNNBOE # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run •RuboCop::CLI.new.runJTBOFOEQPJOU"1* w&BDICPPUrubocopQSPDFTTSVOTSVCPDPQDPNNBOE # Term #1 % rubocop # Term #2 % rubocop # Term #3 % rubocop 4UBSUBOESVO 4UBSUBOESVO 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run 4UBSUBOESVO

Slide 41

Slide 41 text

3VCP$PQQSPDFTT 1*% *OTJEFUSBEJUJPOBMrubocopDPNNBOE # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run •RuboCop::CLI.new.runJTBOFOEQPJOU"1* w&BDICPPUrubocopQSPDFTTSVOTSVCPDPQDPNNBOE # Term #1 % rubocop # Term #2 % rubocop # Term #3 % rubocop 4UBSUBOESVO 4UBSUBOESVO 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run 3VCP$PQQSPDFTT 1*% # exe/rubocop (snip) require 'rubocop' RuboCop::CLI.new.run 1*%TBSFBMXBZTEJ⒎FSFOU 4UBSUBOESVO

Slide 42

Slide 42 text

w/FFETrequire 'rubocop'UPVTFUIF"1* w*ODMVEFTFWFSZUIJOHZPVOFFEGPS 3VCP$PQ w.PTUPGpMFTJTSFRVJSFEBOE JUJTTMPX RuboCop::CLI.new.run"1*

Slide 43

Slide 43 text

SVCPDPQEBFNPOHFN "SFTPMVUJPOCZUIJSEQBSUZ

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 46

Slide 46 text

w"!GPIUFQSPEVDU w&OEPSTFECZTPNFPG*%& JOUFHSBUJPOVTFST w5IBUTXIBUVTFSTSFBMMZXBOU "VTFDBTFESJWFO 8IBUTSVCPDPQEBFNPO

Slide 47

Slide 47 text

)PXEJESVCPDPQEBFNPO NBLF3VCP$PQGBTU

Slide 48

Slide 48 text

w$MJFOU4FSWFSNPEFM w4FSWFS.PEVMFTBSFMPBEFE POMZPODFEVSJOHCPPUQSPDFTT w$MJFOU$POOFDUTUPUIFTFSWFS UIBUBMSFBEZMPBEFENPEVMFT 4FQBSBUFNPEVMFMPBEJOHGSPNCPPUTUSBQ

Slide 49

Slide 49 text

$MJFOU1SPDFTT 1*% 4UBSU%BFNPO 4FSWFS 4FSWFS1SPDFTT 1*% # Loading dependencies. require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon % rubocop-daemon start rubocop rubocop-daemon startTUBSUTTFSWFSQSPDFTT

Slide 50

Slide 50 text

$MJFOU1SPDFTT 1*% 4UBSU%BFNPO 4FSWFS 4FSWFS1SPDFTT 1*% # Loading dependencies. require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon % rubocop-daemon start rubocop rubocop-daemon startTUBSUTUIFQSPDFTTBTEBFNPO Process.daemon(true)

Slide 51

Slide 51 text

6QBOESVOOJOH $MJFOU1SPDFTT 1*% 4UBSU%BFNPO 4FSWFS 4FSWFS1SPDFTT 1*% # Loading dependencies. require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon % rubocop-daemon start rubocop rubocop-daemon startTUBSUTUIFQSPDFTTBTEBFNPO Process.daemon(true)

Slide 52

Slide 52 text

6QBOESVOOJOH $MJFOU1SPDFTT 1*% &YFD3VCP$PQ 7JBDMJFOU 4FSWFS1SPDFTT 1*% # Loaded API RuboCop::CLI.new.run rubocop-daemon % rubocop-daemon exec rubocop rubocop-daemon execSVOTCLI.new.run PGEBFNPO TCP/IP TCPSocket.open('127.0.0.1', port)

Slide 53

Slide 53 text

6QBOESVOOJOH $MJFOU1SPDFTT 1*% &YFD3VCP$PQ 7JBDMJFOU 4FSWFS1SPDFTT 1*% # Loaded API RuboCop::CLI.new.run rubocop-daemon % rubocop-daemon exec $MJFOU1SPDFTT 1*% % rubocop-daemon exec rubocop $POUJOVFUPDPOOFDUUPUIFBMSFBEZSVOOJOHEBFNPO TCP/IP TCP/IP

Slide 54

Slide 54 text

6QBOESVOOJOH $MJFOU1SPDFTT 1*% &YFD3VCP$PQ 7JBDMJFOU 4FSWFS1SPDFTT 1*% # Loaded API RuboCop::CLI.new.run rubocop-daemon % rubocop-daemon exec $MJFOU1SPDFTT 1*% % rubocop-daemon exec rubocop $POUJOVFUPDPOOFDUUPUIFBMSFBEZSVOOJOHEBFNPO "MXBZTUIFTBNF1*% TCP/IP TCP/IP

Slide 55

Slide 55 text

*ODPOWFOJFOUUXPQIBTF

Slide 56

Slide 56 text

SVCPDPQEBFNPOXSBQQFS 4FSWFS1SPDFTT QJE require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon-wrapper rubocop 5IFTIFMMTDSJQUTUBSUTUIFEBFNPOJGJUJTOPUSVOOJOH $MJFOU1SPDFTT QJE if [ ! -f "$TOKEN_PATH" ]; then $RUBOCOP_DAEMON start fi # snip if ! run_rubocop_command $@; then RuboCop::CLI.new.run # ~/.bashrc export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH" ncDNE

Slide 57

Slide 57 text

4FSWFS1SPDFTT QJE require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) SVCPDPQEBFNPOXSBQQFS rubocop-daemon-wrapper rubocop 5IFTIFMMTDSJQUTUBSUTUIFEBFNPOJGJUJTOPUSVOOJOH $MJFOU1SPDFTT QJE if [ ! -f "$TOKEN_PATH" ]; then $RUBOCOP_DAEMON start fi # snip if ! run_rubocop_command $@; then RuboCop::CLI.new.run # ~/.bashrc export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH" ncDNE $RUBOCOP_DAEMON start require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true)

Slide 58

Slide 58 text

SVCPDPQEBFNPOXSBQQFS 4FSWFS1SPDFTT QJE require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon-wrapper rubocop 5IFTIFMMTDSJQUTUBSUTUIFEBFNPOJGJUJTOPUSVOOJOH $MJFOU1SPDFTT QJE if [ ! -f "$TOKEN_PATH" ]; then $RUBOCOP_DAEMON start fi # snip if ! run_rubocop_command $@; then RuboCop::CLI.new.run # ~/.bashrc export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH" ncDNE run_rubocop_command RuboCop::CLI.new.run

Slide 59

Slide 59 text

SVCPDPQEBFNPOXSBQQFS 4FSWFS1SPDFTT QJE require 'rubocop' TCPServer.open('127.0.0.1', port) Process.daemon(true) rubocop-daemon-wrapper rubocop 5IFTIFMMTDSJQUTUBSUTUIFEBFNPOJGJUJTOPUSVOOJOH $MJFOU1SPDFTT QJE if [ ! -f "$TOKEN_PATH" ]; then $RUBOCOP_DAEMON start fi # snip if ! run_rubocop_command $@; then RuboCop::CLI.new.run # ~/.bashrc export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH" ncDNE # ~/.bashrc export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH"

Slide 60

Slide 60 text

*OUFHSBUJPOSVCPDPQEBFNPOJOUP 3VCP$PQJTBVTFGVMBQQSPBDI

Slide 61

Slide 61 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 62

Slide 62 text

SVCPDPQSVCPDPQ 1FSGPSNBODFJNQSPWFNFOUTGPSCFUUFSFEJUPSJOUFHSBUJPO

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

5IJTJTBTUPSZPGIPX* EJE3VCZ,BJHJESJWFO EFWFMPQNFOU "OE*SFHSFUUIBU*EJEOPU SFBDIUIFNJMFTUPOFQVMM SFRVFTUOVNCFS ΩϦ൪ 😅 3*4&61

Slide 65

Slide 65 text

SVCPDPQSVCPDPQ *OUFHSBUFSVCPDPQEBFNPO

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

)PXUPJOUFHSBUFXJUI SVCPDPQEBFNPO

Slide 68

Slide 68 text

$MJFOU1SPDFTT 1*% "CPVUUIFTFSWFSNPEF client process % rubocop --server server process 4QFDJGZ--serverPQUJPOUPCPPUJOTFSWFSNPEF

Slide 69

Slide 69 text

$MJFOU1SPDFTT 1*% "CPVUUIFTFSWFSNPEF 4FSWFS1SPDFTT 1*% require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end client process % rubocop --server server process 4UBSUTFSWFSQSPDFTTFTBOEJOTQFDUTPVSDFDPEF

Slide 70

Slide 70 text

$MJFOU1SPDFTT 1*% "CPVUUIFTFSWFSNPEF 4FSWFS1SPDFTT 1*% require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end client process % rubocop --server $MJFOU1SPDFTT 1*% % rubocop --server server process $POUJOVFUPDPOOFDUUPBOBMSFBEZSVOOJOHTFSWFS "MXBZTUIFTBNFQSPDFTT

Slide 71

Slide 71 text

0VUMJOFPGTFSWFSNPEF

Slide 72

Slide 72 text

wRuboCop::CLI.new.runJTGPS OPTFSWFSNPEF EFGBVMU wRuboCop::Server::CLI.new. runJTGPSTFSWFSNPEF 5XPFOEQPJOU"1*T

Slide 73

Slide 73 text

wrequire 'rubocop'SFRVJSFT NPTUPGpMFT IFBWZXFJHIU wrequire 'rubocop/server'POMZ SFRVJSFTpMFTOFFEFEGPS TFSWFSNPEF MJHIUXFJHIU 3FEVDFSFRVJSFENPEVMFT

Slide 74

Slide 74 text

YGBTUFSNPEVMFMPBEJOH TFD SFRVJSFSVCPDPQ SFRVJSFSVCPDPQTFSWFS wrequire 'rubocop' SFRVJSFTNPTUPGpMFT wrequire 'rubocop/ server'POMZSFRVJSFT pMFTOFFEFEGPS TFSWFSNPEF

Slide 75

Slide 75 text

YGBTUFS % ruby -rbenchmark -e '$LOAD_PATH.unshift("/path/to/rubocop/lib"); Benchmark.bm { |x| x.report { require "rubocop" }}' user system total real 0.573636 0.217166 0.790802 ( 0.815585) % ruby -rbenchmark -e '$LOAD_PATH.unshift("/path/to/rubocop/lib"); Benchmark.bm { |x| x.report { require "rubocop/server" }}' user system total real 0.000386 0.000587 0.000973 ( 0.000969) SFRVJSFSVCPDPQ SFRVJSFSVCPDPQTFSWFS

Slide 76

Slide 76 text

1BTUexe/rubocop $LOAD_PATH.unshift("#{__dir__}/../lib") require 'rubocop' RuboCop::CLI.new.run $PEFTOJQQFU &YFDVUFEFBDIUJNFXJUIUIFASVCPDPQADPNNBOE 3FRVJSFEFBDIUJNFXJUIUIFASVCPDPQADPNNBOE

Slide 77

Slide 77 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF require 'rubocop/server'

Slide 78

Slide 78 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit?

Slide 79

Slide 79 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH $IFDLTFSWFSTUBUVT if RuboCop::Server.running?

Slide 80

Slide 80 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH $IFDLTFSWFSTUBUVT 3VOOJOHXJUITFSWFSNPEF exit_status = RuboCop::Server::ClientCommand::Exec.new.run

Slide 81

Slide 81 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH $IFDLTFSWFSTUBUVT 3VOOJOHXJUIOPTFSWFSNPEF 3VOOJOHXJUITFSWFSNPEF require 'rubocop' cli = RuboCop::CLI.new.run

Slide 82

Slide 82 text

$VSSFOUexe/rubocop "GUFS require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH $IFDLTFSWFSTUBUVT 3VOOJOHXJUIOPTFSWFSNPEF 3VOOJOHXJUITFSWFSNPEF require 'rubocop' cli = RuboCop::CLI.new.run 4MPX

Slide 83

Slide 83 text

.VDIMJHIUFSUIBOrequire 'rubocop' require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end $PEFTOJQQFU .BLFBMJHIUXFJHIUEFQFOEFODZSFRVJSF 4FSWFSNPEFTFUVQ FHTUBSUJOHBOETUPQQJOH $IFDLTFSWFSTUBUVT 3VOOJOHXJUITFSWFSNPEF server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? exit_status = RuboCop::Server::ClientCommand::Exec.new.run require 'rubocop/server' if RuboCop::Server.running?

Slide 84

Slide 84 text

$MJFOU1SPDFTT 1*% &YFD3VCP$PQXJUITFSWFS 4FSWFS1SPDFTT 1*% require 'rubocop/server' server_cli = RuboCop::Server::CLI.new exit_status = server_cli.run exit exit_status if server_cli.exit? if RuboCop::Server.running? exit_status = RuboCop::Server::ClientCommand::Exec.new.run else require 'rubocop' cli = RuboCop::CLI.new.run end rubocop client % rubocop --server $MJFOU1SPDFTT 1*% % rubocop --server rubocop server $POUJOVFUPDPOOFDUUPBOBMSFBEZSVOOJOHTFSWFS "MXBZTUIFTBNFQSPDFTT

Slide 85

Slide 85 text

w0CKFDUTMPBEFEXJUIrequire require_relativeFUD JUJTJO NFNPSZ w5IFTFSWFSQSPDFTTJTGBTUFSXIFO SFRVJSFENPEVMFTBSFMPBEFE 4QFFEVQXJUITFSWFS

Slide 86

Slide 86 text

1SPHSBNNJOHXIBUJTDPEFEBOE XIBUJTOPUDPEFE !LBLVUBOJTBZT IUUQTTQFBLFSEFDLDPNLBLVUBOJBHJMFNBOJGFTUPEFDBEF TMJEF

Slide 87

Slide 87 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 88

Slide 88 text

$PNNBOEMJOF"1*EFTJHO

Slide 89

Slide 89 text

$PNNBOEMJOF"1*EFTJHO IUUQTHJUIVCDPNSVCPDPQSVCPDPQQVMMJTTVFDPNNFOU rubocop --serverWTrubocop-server

Slide 90

Slide 90 text

w"OPUIFSPQUJPOJTrubocop-server DPNNBOEGPSTFSWFSNPEF w*UJTFBTZUPEFTJHOUIFTFSWFSQPSU OVNCFSBTBDPNNBOEMJOFBSHVNFOU w-JLFemacsclientDPNNBOE 8IZOPUrubocop-server

Slide 91

Slide 91 text

wSVCPDPQEBFNPOVTFSTTFFNUPXBOUUPTUBSUUIF TFSWFSXJUIrubocopDPNNBOE JGUIFTFSWFSJTOPU TUBSUFE w5IBUTXIZrubocop-daemon-wrapperJTQSPWJEFE w"GUFSBMM*BMJBTUPFNBDT •alias emacs='emacsclient -nw -a ""' w*DIPTFUPBEE--serverPQUJPOUPUIFrubocopDPNNBOE 8IZOPUrubocop-server

Slide 92

Slide 92 text

*NQPSUFESVCPDPQEBFNPOPQUJPOT SVCPDPQEBFNPO SVCPDPQ OPUF FYFD rubocop-daemon exec rubocop --server rubocopJTBMTP0,BGUFS TUBSUJOHUIFTFSWFS FYFDXP TFSWFS N/A rubocop --no-server %FGBVMUXJUIPVUTFSWFS PQUJPOT TUBSUTFSWFS rubocop-daemon start rubocop --start-server )PTUBOEQPSUDBOCF TQFDJpFEXJUIFOWWBST TUPQTFSWFS rubocop-daemon stop rubocop --stop-server SFTUBSU rubocop-daemon restart rubocop --restart-server TUBUVT rubocop-daemon status rubocop --server-status TUBSUFYFD rubocop-daemon-wrapper rubocop --server

Slide 93

Slide 93 text

4FSWFSNPEFPQUJPOT

Slide 94

Slide 94 text

w5IFEFGBVMUCFIBWJPS w3VOXJUIPVUTFSWFS w*UTDPNQBUJCMFXJUIPME3VCP$PQ WFSTJPOT w*UTTUBCMFCVUTMPX --no-server EFGBVMU

Slide 95

Slide 95 text

w3VOJOTQFDUJPOBGUFSTUBSUJOHSVCPDPQ TFSWFSQSPDFTTJGOPUTUBSUFE w"GUFSFYFDVUJOH--serverPQUJPO rubocopDPNNBOESVOTBTDMJFOU w*EMJLFUPDSFBUFBTIPSUOBNFCVU-sJT BMSFBEZVTFE --server

Slide 96

Slide 96 text

w4FSWFSQSPDFTTOBNFJT rubocop --server #{dirname} w3VCP$PQTFSWFSTBSFBTTPDJBUFEXJUI UIFEJSFDUPSZJOXIJDIUIFZXFSFTUBSUFE 4FSWFSQSPDFTTOBNF % ps aux | grep 'rubocop --server' user 16060 0.0 0.0 5078568 2264 ?? S 7:54AM 0:00.00 rubocop --server /Users/koic/src/github.com/esminc/foo user 16337 0.0 0.0 5331560 2396 ?? S 23:51PM 0:00.00 rubocop --server /Users/koic/src/github.com/esminc/bar

Slide 97

Slide 97 text

w4UZMFTXJMMWBSZGSPNQSPKFDUUPQSPKFDU w$POpHVSFTSVMFTCZSVCPDPQZNM w&BDITFSWFSIBTJUTPXOQSPKFDU TFUUJOHT w4FSWFSTUBSUTGPSFBDIQSPKFDU TP JOEFQFOEFOUQSPKFDUQSFGFSFODFTBQQMZ $POpHVSBUJPOTBSFOFWFSNJYFE

Slide 98

Slide 98 text

w4UBSU3VCP$PQTFSWFSQSPDFTT w6TFXIFOZPVXBOUUPTUBSUUIFTFSWFSPOMZ w5$1IPTUBOEQPSUDBOCFTQFDJpFEXJUIFOWJSPONFOU WBSJBCMFT w$RUBOCOP_SERVER_HOST w$RUBOCOP_SERVER_PORT wFH3VCP$PQ4FSWFSSVOTBT%PDLFSDPOUBJOFSBOE VTFSVTFTMJLFrubocop-daemon-wrapperPOIPTUNBDIJOF --start-server

Slide 99

Slide 99 text

w4UPQ3VCP$PQTFSWFSQSPDFTT w6TFUIJTPQUJPOXIFOTFSWFS NPEFJTVOTUBCMF wFH6QEBUFHFN DPOpHVSBUJPO BOEFUD --stop-server

Slide 100

Slide 100 text

w3FTUBSUTFSWFSQSPDFTT w4IPSUIBOEGPSTUPQBOETUBSU w:PVNBZVTFJUBGUFSbundle updateXIFO3VCP$PQTFSWFSJT VOTUBCMF --restart-server

Slide 101

Slide 101 text

w:PVDBODPOpSNTFSWFS TUBUVT w4IPXOXJUI1*%XIFOSVOOJOH --server-status % rubocop --server-status RuboCop server (25960) is running. % rubocop --server-status RuboCop server is not running.

Slide 102

Slide 102 text

w:PVDBOBMTPDPOpSNrubocop -V w+serverJTBEEFE w-VPQUJPOQSPWJEFTJOGPVTFEJOJTTVFSFQPSUT w-JLFruby -vGPSFOBCMF:+*5 +YJITJTBEEFE rubocop -V -BSHF7 % ruby --yjit -ve 'RubyVM::YJIT.enabled?' ruby 3.2.0dev (2022-09-08T05:31:42Z master 78af05ba0f) +YJIT [x86_64-darwin19] % rubocop -V 1.36.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.2.0) +server [x86_64-darwin19]

Slide 103

Slide 103 text

" 3VOrubocopXJUIPVUTFSWFS QSPDFTTJGUIFQSPDFTTJTOPU SVOOJOH # 3VOrubocopXJUITFSWFSQSPDFTT JGUIFQSPDFTTJTSVOOJOH /PTFSWFSPQUJPOTHJWFO

Slide 104

Slide 104 text

w*GZPVFODPVOUFSFE VOFYQFDUFECFIBWJPST 3VO rubocop--restart-server w"OEZPVDBOPQFOBOJTTVFUP UIFSVCPDPQSVCPDPQSFQP "UUFOUJPOT

Slide 105

Slide 105 text

1BTUBOEDVSSFOU 8IBUTSVCPDPQEBFNPO *OUFHSBUFXJUISVCPDPQEBFNPO 5IFTFSWFSNPEF"1*EFTJHO 4FSWFSQSPDFTTBOEDBDIJOHpMFT "HFOEB

Slide 106

Slide 106 text

4FSWFSQSPDFTTBOE DBDIJOHpMFT

Slide 107

Slide 107 text

w3VCP$PQTFSWFSNPEF VTFT5$1*1QSPUPDPM w*ULFFQTUIFTFSWFST1*% FUDJOUIFDBDIFEJSFDUPSZ "CPVUUIFTFSWFSNPEFQSPUPDPM

Slide 108

Slide 108 text

$MJFOU1SPDFTT 1*% TU4UBSUBOEFYFDUIFTFSWFS 4FSWFS1SPDFTT 1*% client % rubocop --server server 4UBSUBOFXTFSWFSQSPDFTTBOEHFUUIF1*% Socket

Slide 109

Slide 109 text

DBDIFSVCPDPQ@DBDIFTFSWFS $MJFOU1SPDFTT 1*% TU4UBSUBOEFYFDUIFTFSWFS 4FSWFS1SPDFTT 1*% % rubocop --server 8SJUFQJE QPSU WFSTJPO BOEPUIFSTUPDBDIFpMFT QJE QPSU WFSTJPO Disk IO client server

Slide 110

Slide 110 text

DBDIFSVCPDPQ@DBDIFTFSWFS $MJFOU1SPDFTT 1*% OE&YFDUIFTFSWFS 4FSWFS1SPDFTT 1*% % rubocop --server 3FBEQJE QPSU WFSTJPO BOEPUIFSTUPDBDIFpMFT QJE QPSU WFSTJPO $MJFOU1SPDFTT 1*% % rubocop (--server) Disk IO client server

Slide 111

Slide 111 text

DBDIFSVCPDPQ@DBDIFTFSWFS $MJFOU1SPDFTT 1*% OE&YFDUIFTFSWFS 4FSWFS1SPDFTT 1*% % rubocop --server $POOFDUUPUIFTFSWFSQSPDFTTBOEJOTQFDUJPO QJE QPSU WFSTJPO $MJFOU1SPDFTT 1*% % rubocop (--server) Socket client server

Slide 112

Slide 112 text

DBDIFSVCPDPQ@DBDIFTFSWFS $MJFOU1SPDFTT 1*% 5IFDBDIFEJSFDUPSZ 4FSWFS1SPDFTT 1*% % rubocop --server 5IFDBDIFJTQMBDFEJO~/.cacheEJSFDUPSZCZEFGBVMU QJE QPSU WFSTJPO $MJFOU1SPDFTT 1*% % rubocop (--server) client server

Slide 113

Slide 113 text

DBDIFSVCPDPQ@DBDIFTFSWFS $MJFOU1SPDFTT 1*% 5IFDBDIFEJSFDUPSZ 4FSWFS1SPDFTT 1*% % rubocop --server 3FTUBSUUIFQSPDFTTXIFOBGUFSbundle update QJE QPSU WFSTJPO $MJFOU1SPDFTT 1*% % rubocop (--server) 5IFDMJFOUDPNNBOESFTUBSUTUIFTFSWFS QSPDFTTJGJUEFUFDUTJODPNQBUJCMFWFSTJPO client server

Slide 114

Slide 114 text

w6OGPSUVOBUFMZJUTTUJMMBCJU FYQFSJNFOUBM wrubocop --restart-serverXJMM TUJMMCFOFDFTTBSZJOTPNF TJUVBUJPOT $BOTFSWFSNPEFCFUIFEFGBVMU

Slide 115

Slide 115 text

w.BLFBVUPSFMPBEBXBSFPG VQHSBEJOHSEQBSUZHFNT w6/*9EPNBJOTPDLFUPQUJPOJGGBTUFS w1SPWJEFTPQUJPOTGPSTIPSUBMJBTFT w4VQQPSU+3VCZ 4FSWFSNPEFFOIBODFEQMBOT

Slide 116

Slide 116 text

wrubocop --serverDBONBLF 3VCP$PQGBTUFS wrubocop --restart-serverNBZ TPMWFZPVSTFSWFSNPEFJTTVF 6TFGVMPQUJPOT

Slide 117

Slide 117 text

-FBSOGSPNZFTUFSEBZ rubocop.org MJWFGPSUPEBZ IPQFGPSUPNPSSPX ʔAlbert Einstein