RuboCop: Line is too long ← How to Ignore?

前端 未结 3 2066
孤独总比滥情好
孤独总比滥情好 2021-01-30 15:59

I just added RuboCop to a rails project and installed the Sublime package to see RuboCop suggestions in the editor. I\'m trying to figure out how to change the maximum line leng

3条回答
  •  天涯浪人
    2021-01-30 16:04

    With latest changes at rubocop gem version 0.78.0 at 18-12-2019, from now on LineLength cop move from Metrics department to Layout department. So basically if any one need to disable long lines with using version number higher than 0.78.0 should do it like this.

    # rubocop:disable Layout/LineLength
      "I'm a really long line"
    # rubocop:enable Layout/LineLength
    

    Also .rubocop.yml configuration is changed to this.

    Layout/LineLength:
      Max: 100
    

    For reaching rubocop change logs, click here

提交回复
热议问题