RubyKaigi Takeout 2020 ã«ç»å£ããã
æ¬ç·¨ç»å£ã¯ RubyKaigi 2018 ä»¥æ¥ 2 åç®ãå»å¹´ RubyKaigi 2019 ã§ã¯ LT ç»å£ã§ TracePoint ã使ããã¨ã«ãã£ã¦ä»è¾¼ãã§ãã¾ã£ããã°ã®è©±ããã¦ããã
ä»åã®ã¹ã©ã¤ãã¯ä»¥ä¸ã§ãã
RuboCop 1.0 ã«åãã話
æ¬ç·¨ãã RuboCop 1.0 ã«åãã話ãããã¤ãããã¯ã¢ãããã¦ããã¾ããå¾è¿°ã®åé²ã¸ã®åé¡ããã£ããããç¹ã«çµç¤ãã³ããä¸ãã£ã¦ãããã¨ããããã¹ãã¨ãã¦å°ãè£è¶³ãã¦ããã¾ãã
æ¡å¼µ API ã®å¤æ´
æ¡å¼µ Cop ã®éçºè åãã® API ã¯ä»¥ä¸ã®ããã«å¤æ´ã«ãªãã¾ãã
ããã¾ã§ã® API:
class CustomCop < Cop  def on_send(node)  end  def autocorrect(node)  end end
ããããã® API:
class CustomCop < Base  extend AutoCorrector  def on_send(node)   add_offense(node) do |corrector|   end  end end
å¾æ¥ã® RuboCop::Cop::Cop
ã¯ããã«åé¤ããããã®ã§ã¯ãªã soft deprecated ãªãã®ã§ãããä»å¾ã¯ RuboCop::Cop::Base
ã使ããã¨ããããã¾ããRuboCop èªä½ãã¾ã 移è¡ä¸ã§ããä¾åãã¦ãã Parser å®è£
ããå¤ãã£ã¦ãããããã¾ã äºæãã¦ããªãä¸å
·åãæã£ã¦ããå¯è½æ§ãããã¾ããä½ãåé¡ãè¦ã¤ããã rubocop-hq ã¾ã§ãé£çµ¡ãã ããã
Safe / SafeAutoCorrect
RuboCop ã«ã¯ Safe
㨠SafeAutoCorrect
ã¨ããæ¦å¿µãããã¾ãã
Safe
ã¯å½é½æ§ãèµ·ãããã¨ãªãæ¤åºã§ãããã©ããã«ãã£ã¦ãé¿ãããã¨ãé£ããå½é½æ§ãç®ç«ã£ããã®ã¯å®å
¨ã§ãªã Safe: false
ããã¼ã¯ããã¦ãã¾ãã
SafeAutoCorrect
ã¯æ¯ãèãã®äºææ§ãç¶æã§ãããã©ããã§ãããã¡ãã RuboCop ã®ææ¡ã«ããå¤æ´ã§éäºæãèµ·ãããã®ã¯ SafeAutoCorrect: false
ãè¨å®ããã¦ãã¾ããã¾ãå½é½æ§ãæã£ãã¾ã¾ã®å¤æ´ãããã¨ã§å£ãããã¨ãé²ããã Safe: false
ã¨ããã¦ãããã®ã¯ SafeAutoCorrect: false
ã§ãã
ã¨ãããæè¿ã®éè¦ãªå¤æ´ç¹ã¨ãã¦ãrubocop -a
ãªãã·ã§ã³ã®æåå¤æ´ã¨ rubocop -A
ãªãã·ã§ã³ã®å°å
¥ã§ããåè
ã¯å®å
¨ãª Cop ã§ã®ã¿èªåä¿®æ£ãè¡ããã®ã§ãå¾è
ã¯å®å
¨ã§ãªã Cop ãå«ãã¦èªåä¿®æ£ãè¡ããã®ã§ãã
RuboCop 0.86 以åã§ã¯ãfrozen stirng magic comment ã追å ããå ´å㯠rubocop -a
ã§ããããfrozen string ã«ãªã£ããã¨ã§ç ´å£çã¡ã½ããã¸ã®å¼ã³åºãããããããªå ´åãªã©éäºæã®å¤æ´ã«ãªãå¯è½æ§ãããã¾ãããã®ãããªå®å
¨ã§ãªã Cop ã§ã®èªåä¿®æ£ãå®è¡ãããå ´å㯠rubocop -A
ã³ãã³ãã使ããã¨ã«ãªãã¾ãã
以ä¸ã®ã¨ã³ããªãåèã«ãã¦ãã ããã
pending ã¹ãã¼ã¿ã¹
ãããã¾ä½¿ã£ã¦ãã RuboCop ãã¡ãã£ã¨å¤ãã¦ã¢ããã°ã¬ã¼ããã¥ããã¨ãã£ãåé¡ã¯ãCop ã¸ã® pending ã¹ãã¼ã¿ã¹ã®å°å ¥ã§ã®è»½æ¸ãå³ã£ã¦ãã¾ãã
ããä½ãã¼ã¸ã§ã³ã㧠RuboCop ã«è¿½å ãããæ°ãã Cop 㯠1.0 ã¾ã§ã¯ pending ã¨ããã¹ãã¼ã¿ã¹ã§ãããã©ã«ãã§ã¯æå¹ã«ãªã£ã¦ãã¾ãããã¦ã¼ã¶ã¼ãæ示çã« .rubocop.yml ã¸ã® Enabled: true
ã Enabled: false
ãæå®ãã¦ã©ããããã決ããããã«ãªã£ã¦ãã¾ãã
pending ã¹ãã¼ã¿ã¹ã®ãã®ã¯ RuboCop 1.0 ã§æå¹ã«ãªãã¾ãã®ã§ãããããã¾ã§ã«ããã©ã«ãã§æå¹ã«ãªãã¹ãã§ãªã Cop ãè¦ãããã RuboCop HQ ã¾ã§ãç¥ãããã ããã
æ¬ç·¨åé²ã«ããã£ã¦
é³æ¥½ CD ã§ã©ã¤ãç¤ã¨ã¹ã¿ã¸ãªç¤ãããããã«ãããã¾ã§ãµã ããã©ã¤ãã ã£ãã¨ããã¨ãä»åã¯ããã¦ã®ã¹ã¿ã¸ãªç¤ã®åé²ã¨ãªã£ã¦ãªããªãæãããã«è¡ããªãã£ãããã®ç¹ãæ¸ãæ®ãã¦ããã
ã¹ã©ã¤ãã¨é²é³ãåæãããæ¹æ³ã¨ã㦠RubyKaigi ãã¼ã ããç´¹ä»ããããæ®æ®µä½¿ãã®ãã¬ã¼ã³ãã¼ã·ã§ã³ãã¼ã«ã Keynote ãªã®ã§ãKeynote ã§ã®é²é³ãæéãããã¨é²ãã¦ããã
å®ã¯ããã§ãããããã¨ãã£ã¦ãæå ã®ç°å¢ãå¤ããã¦é²é³æ©è½ããªã Keynote 6.0 (2013å¹´) ããã®ã¢ããã°ã¬ã¼ãã¨ããã®ãæåã«å¿ è¦ã ã£ããããã¦ããããã® macOS ãå¤ããã OS ã®ã¢ããã°ã¬ã¼ããå¿ è¦ã§ã¨ãªãããã®ãããã®ã»ããã¢ããã«æéã使ããããããã
æå ã® Keynote 6.0 (2013å¹´) ã«é²é³æ©è½ããªããããªãããKeynote ãã¢ããã°ã¬ã¼ããããã¨ããã macOS 10.14 以ä¸ã¸ã®ã¢ããã°ã¬ã¼ããå¿ è¦ã§ãMBP ã®è£½é ã¢ãã«ã¯è¯ãããã ããã©ç©ºãé åããªã㦠Windows VM ã®åé¤ãã㦠OS ãã¦ã³ãã¼ããã¾ããã
— Koichi ITO (@koic) 2020å¹´8æ14æ¥
ãã®ãã¨ã¯ã¹ã©ã¤ãã¸ã®é³é²ãã«ãªãããã© Keynote ã®é²é³æ©è½ã®ä½¿ãæ¹ã調ã¹ã¤ã¤è¦ãã¦ãã£ãããã¼ã¸åãæ¿ãã®ã¿ã¤ãã³ã°ã«ãã£ã¦ããé³è³ªãå¤ããã®ã¯ããã¾ãé²é³ã§ãã¦ããç®æã¾ã§æ»ãã¦ããç´ããã²ã¨å¼å¸åãããã®ãã®ã ã£ãã
ããã¦ã¤ã³ã¿ã¼ãããã®åããã«ã人ãããªã PC ã«åãã£ã¦è©±ãã¨ãããã¨ãã§ããªãã¦ãå ¨ç·¨ããã¹ãèµ·ãããããã¨ãããã¨ããã¦ãããçèå°å¥³å¸¯ã®ã詩人ãªã¦ã ã®ä¸çãã®ã®ã¿ã¼ã½ãã¯ãµã ãã¢ããªãã§å¼¾ãã¦ããã¨ãããèé¢ã«èµ·ãããã¨ããé¸è©±ããã¨ã«ãããã®ã ã£ãããã©ã以ä¸ã®ããã«ãã¾ããã£ãé¨åã¨ããã§ãªãé¨åããã£ãã
- 話ãå§ããã«ããããä½ãã話ãã¦ãããã®æµããã§ãã¦ããã®ã¯è¯ã
- æ¥ãã§ããã¹ãèµ·ããããããã±ã§ããã°ã£ã¦ããããã¹ãããã®ã¾ã¾èªã¿ä¸ãã¦ãã¾ã£ã¦ããç®æããã (Opal ã¸ã®èª¬æãã¹ã¨ã)
ã¯ããã¦ã®è©¦ã¿ã£ã½ããã°ã¨ãã¦ããã¹ããèªã¿ã¤ã¤ãã©ã¤ãæãä½ãããã¦ãæµãã«ä¹ã£ãã¿ã¤ãã³ã°ã§ããã¹ãããå¤ããã¨ãããã®ã ã£ããã©ã£ã¡ã¤ããã®å¼å®³ã§ããã
ãããã£ããã¨ããã£ã¦ããã¨ãã¿ã¤ã ãã¼ãã³ã°ãçãã«ãªã£ã¦çµç¤ãç³ã¿æãããããªã¹ãã¼ãã§åãã«è¡ããã¨ã«ãªã£ããçµæã¨ã㦠25åç¨åº¦ã¨ãããªãã¡ã¼ã®ã¨ãã 25å54ç§ã ã£ãã®ã§ãæå¾ã¯ç·¨éã§å°ãã«ããã§ããªãããã£ã¦ã¿ããã¨ããããã©ãã½ããã®é¸å®ã使ãæ¹ãè¦ããã¾ã§è¾¿ãçããæ念ãããã¯æéã®ä¸ã§ããªããã¹ãã«ãäºãç²å¾ãã¦ãããã¨ããçµé¨ããã®ãããä¸çç·ã ã£ã (ããã¦ãã®ã¹ãã«ã¯ç¾ç¶æã¡ãããã¦ããªãã£ã) ã ãã¡ããè¦ãããã¨ã¨ãã¦ããã¨ã§ç·¨éããããããã«ã¾ã¨ã¾ãã®ããã¹ã©ã¤ããã¨ã«é³å£°ãåãã¦ããã¨è¯ãã¨ããç¥èãå¾ããã¨ãã§ããããã¼ã¸åãæ¿ãã®ã¿ã¤ãã³ã°ã§è©±ãã¦ããã¨ãã®ãã¼ãã ããåé¤ãããã¨ããç·¨éãã§ããªããªãã®ãçç±ã
ã㨠MacBook Pro ã®å èµãã¤ã¯ã§åé²ãã¦ããããã©ãéä¸é³è³ªãã¬ã©ãã¨å¤ããé¨åããã£ããæ©æèªä½ã¯å¤ãã¦ããªãã®ã§å§¿å¢ããã¤ã¯è·é¢ãå¤ãã£ããªã©ã§ãé³ã®å½ã¦æ¹ãå¤ãã£ã¦ããã®ã§ã¯ã¨æãããã®ãããé³è³ªãæ ä¿ããã®ã§ããã°ããããã®æ©æã使ã£ãæ¹ãè¯ããã (ä»ç¾å¨ã¯æã£ã¦ããªãã®ã§ãã) ã
以ä¸ã®ãããªå¤±æçµé¨ããã¦ãã¦ãå¾ãè¯ãæ©ä¼ã«ããªã£ãã®ãä»åã®ã¹ã©ã¤ãä½æã ã£ãã次åã¯ããå°ããã¾ãã§ããããããªãããªã¨æã£ã¦ããã
RubyKaigi Takeout èªä½ã¯ããªã¢ã¼ããªãã RubyKaigi æããã£ã¦è¯ãã£ããåé²æ¸ã¿ã®é ä¿¡ã§ãããã®ã®ã¿ã¤ã ãã¼ãã«ããã£ãã®ãè¯ãèå°è£ ç½®ã«ãªã£ã¦ããã®ã§ã¯ã¨æã£ã¦ãããå¤åå ã§ã¯ã¿ã¤ã ãã¼ãã«ãè¦ãä¼ãå®æ½ããããå½æ¥ã¯ã©ã¡ãã®ãã©ãã¯ãèãããæ©ãã ãã§ãã¦ãã¤ããªããã®ã¢ã¯ãã£ããã£ãèµ·ãããã£ããã«ã§ããã®ã¯å¤§ããã£ãã¨æããã³ã³ãã³ãã¨ãã¦ã¯ Parser ã使ã£ããã©ã³ã¹ãã¤ã«ã®è©±ãããã¤ããã£ãããããã«ä¼´ã£ã¦è¦æ £ãã S å¼ãåºã¦ãããã¨ãæ®æ®µã® OSS æ´»åã§åãã¦ããç¹ç°æè¡ã¨ãªã³ã¯ãããããã¯ãªããã¯ã¨ãããèå³æ·±ãèãã¦ãã¾ããã
楽ããã£ãã§ããRubyKaigi Takeout 2020 ã®é¢ä¿è ã®ã¿ãªããããããã¨ããããã¾ããã