Rails: rubocop disable Class has too many lines error

fedest picture fedest · Oct 24, 2016 · Viewed 20.8k times · Source

I have a class with constants, many constants. And rubocop is complaining about the length of this Class, which I don't care how long it gets.

I want to disable rubocop's error: "Class has too many lines" but the following is not working:

# rubocop:disable ClassLength

Also, the following isn't either:

# rubocop:disable Metrics/ClassLength

What is the correct metric that I need to disable?

Answer

AnoE picture AnoE · Oct 24, 2016

Try

class Xzy  # rubocop:disable Metrics/ClassLength