RuboCop 㯠Ruby ã® EOL ãã¼ã¸ã§ã³ã«ã¤ãã¦ãEOL ã® 1å¹´å¾ã¾ã§ãµãã¼ããã¦ãã¾ãã
RuboCop ã® Ruby ãã¼ã¸ã§ã³ãµãã¼ãã¨ãã£ãæã«ãã©ã³ã¿ã¤ã ãã¼ã¸ã§ã³ãã¨ã解æãã¼ã¸ã§ã³ãã® 2 ã¤ãããããã®ã¨ã³ããªãæ¸ãã¦ããæç¹ã®ææ° RuboCop 1.30 ãªãªã¼ã¹ã¾ã§ããã®ãµãã¤ã®ãã¼ã¸ã§ã³ãæ··åãããç¶æ ã§ã©ã¤ããµã¤ã¯ã«ãå ±ã«ãã¦ãã¾ããã
ããã§ããããã®ãã¼ã¸ã§ã³ãããããã
- ã©ã³ã¿ã¤ã ãã¼ã¸ã§ã³ ... RuboCop ãå®è¡ãã Ruby ã®ãã¼ã¸ã§ã³ã
rubocop
ã³ãã³ããå®è¡ããruby
å¦çç³»ã®ãã¼ã¸ã§ã³ã§ãã - 解æãã¼ã¸ã§ã³ ... RuboCop ã解æãã Ruby ã³ã¼ãã®ãã¼ã¸ã§ã³ã.rubocop.yml ã®
TargetRubyVersion
ãªã©ã§æå®ãã¦ãããã¼ã¸ã§ã³ã§ãã詳ããã¯ãã¡ãã®éå»è¨äºãã©ããã
ä¾ãã° Ruby 2.5 㯠RuboCop 1.28 ã§ãµãã¼ãæã¡åããRuby 2.4 㯠RuboCop 1.12 ã§ãµãã¼ãæã¡åãã¨ãªã£ã¦ãã¾ããããã㯠ãã©ã³ã¿ã¤ã ãã¼ã¸ã§ã³ãã¨ã解æãã¼ã¸ã§ã³ãã®ä¸¡æ¹ãæå³ãã¦ãã¾ããã
RuboCop 1.30 ã§ã¯ãRuby 2.5 以ä¸ãã©ã³ã¿ã¤ã ãã¼ã¸ã§ã³ã¯ä½¿ããã¨ã¯ã§ãã¾ããããTargetRubyVersion
㧠Ruby 2.0 以ä¸ãæå®ãããã¨ãã§ããããã«ãªã£ã¦ãã¾ãã
ä¾ãã°ãGem éçºã§å¤ã Ruby ãã¼ã¸ã§ã³ããæ°ãã Ruby ãã¼ã¸ã§ã³ã¾ã§ããµãã¼ããããã¨ãããã¼ãºããå¤ã Ruby ãã¼ã¸ã§ã³ã®ã¢ããªã±ã¼ã·ã§ã³ã ãã© RuboCop ã¯ã¢ããã°ã¬ã¼ããã¦æ°ããæ©è½ã使ãããã¨ãã£ããã¨ã«å¯¾å¿ã§ãã¾ãã
ç¹ã«åè
ã¯ãRuboCop ããµãã¼ããã¼ã¸ã§ã³ãæã¡åã£ããããGem ã® Ruby æå°è¦æ±ãã¼ã¸ã§ã³ãç¹°ãä¸ãããã¨ããäºä¾ãããã¤ãè¦ã¦ãã¦ãããRuboCop ã Gem ã®ã¡ã³ããã³ã¹ãµã¤ã¯ã«ã«ä½ç¨ããã®ãã¨ã³ãã¦ã¼ã¶ã¼ã«ã¨ã£ã¦å¹¸ããã¨ããçåã解決ããå½¢ã«ãªãã¾ã (TargetRubyVersion
㧠Ruby 2.0 ã¾ã§è§£æå¯è½ã«ãªã£ãã®ã§) ã
GitHub Actions ãªã©ã§ RuboCop ããªã³ã¿ã¼ã¨ãã¦ããå ´åã¯ãRuby 2.6 以ä¸ãã¯ã¼ã¯ããã¼ã®ã©ã³ã¿ã¤ã Ruby ãã¼ã¸ã§ã³ã«æå®ãã¦ã.rubocop.yml ã® TargetRubyVersion
ã«æå°è¦æ±ã® Ruby ãã¼ã¸ã§ã³ãæå®ããã¨è¯ãã§ãããã
ã¡ãªã¿ã«ãRuby 1.9 㯠Ruby 2.0 以éã¨ã®éäºæã«ãã Cop ã®ã¡ã³ããã³ã¹ã³ã¹ãã®æ¹ãé«ãã¤ããããªã®ã§ããããããµãã¼ããã¾ããã
å æ¥å ¬éãããã2022 Ruby on Rails Community Survey Resultsãã® Ruby ãã¼ã¸ã§ã³ã®å©ç¨ç調æ»ã ã¨ãEOL ã®å©ç¨ã¯ Ruby 2.6 (15%) ãRuby 2.5 (8%) ãRuby 2.4 (4%) ãRuby 2.3 (3%) ãRuby 2.2 (1%) ãRuby 2.1 (1%) ãRuby 2.0 (0%) ãRuby 1.9 (2%) ãRuby 1.8 (1%) ã¨ãããã¨ã§ãå ¨ä½ã® 35% ãããããããã§ãããã®ãã¡ Ruby 2.0 ~ 2.6 ã¾ã§ã® 32% ãããã¯æããã ãããï¼ã¨ãã£ãã¨ããã
ã¨ã¯ãããã¢ããªã±ã¼ã·ã§ã³ã§ããã°ã¯ããã« Ruby ãã¼ã¸ã§ã³ã®ã¢ããã°ã¬ã¼ãããã¦ãããã¨è¯ãã§ããã