You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This setting appears to have been part of a large import of default Rubocop settings and not an explicitly decided and a settled matter. It also sounds like this was at one time a rubocop default, and that does not appear to be the case today when I ran standardrb and rubocop autofixing over the same code. It may be that the default changed upstream.
Not only does this double spacing make the code longer - and you'd expect single-line methods to be used for terseness - but the method grouping is lost, which conveys less information to the developer. My example is contrived, but I have seen this formatting make real, production code harder to read also.
The text was updated successfully, but these errors were encountered:
I propose a rule change which would allow visual grouping of oneline methods, which can convey semantic meaning.
The relevant setting
AllowAdjacentOneLineDefs
is under Layout/EmptyLineBetweenDefsThis setting appears to have been part of a large import of default Rubocop settings and not an explicitly decided and a settled matter. It also sounds like this was at one time a rubocop default, and that does not appear to be the case today when I ran standardrb and rubocop autofixing over the same code. It may be that the default changed upstream.
A contrived example of what happens today:
which would get formatted by standardrb today as
Not only does this double spacing make the code longer - and you'd expect single-line methods to be used for terseness - but the method grouping is lost, which conveys less information to the developer. My example is contrived, but I have seen this formatting make real, production code harder to read also.
The text was updated successfully, but these errors were encountered: