RuboCop: Line is too long ← How to Ignore?

前端 未结 3 2032
孤独总比滥情好
孤独总比滥情好 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:06

    In your code, you can disable a bunch of lines like this:

    # rubocop:disable LineLength
    puts "This line is lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng"
    # rubocop:enable LineLength
    

    Or add this to your .rubocop.yml file to increase the max length:

    Metrics/LineLength:
      Max: 100
    

提交回复
热议问题