4 ms·
I feel the discussion about consistency is moot because, in my experience, linters often have a different idea about consistency than humans. Let's say I have
by gurkendoktor 6y ago
I feel the discussion about consistency is moot because, in my experience, linters often have a different idea about consistency than humans.
Let's say I have the following three methods:
def foo
if broken?
:error
else
@x
end
end
def bar
if broken?
5
else
@y
end
end
def qux
if broken?
nil
else
@z
end
end
If Rubocop forces me to reformat the last method as a one-liner because nil is returned implicitly, is this really more consistent (because it follows Rubocop's predictable rules)? Or is it less consistent (because these functions lose their common structure)?