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
Is your feature request related to a problem? Please describe.
The Layout/SpaceAfterColon, checks space needed between colon and value in ruby 1.9 hash syntax. It's already check with Layout/AlignHash.
Each style describe in this latter cop guarantee at least one space between separators and values.
Also since #6649 release in 0.70.0 (2019-05-21), user can choose multiple alignement style, reinforcing the feeling than the Layout/SpaceAfterColon cop is become useless.
Describe the solution you'd like
Remove this cop which has become useless.
What do you think ?
The text was updated successfully, but these errors were encountered:
I think that roles of Layout/SpaceAfterColon cop and Layout/AlignHash cop are different.
Layout/AlignHash cop is a cop for Hash style. For example, Layout/SpaceAfterColon cop has detected a kwargs. This is not detected by Layout/AlignHash cop.
% cat example.rb
# frozen_string_literal: truedef m(foo:1, bar:2)end
% rubocopInspecting 1 fileCOffenses:example.rb:3:1: C: Style/EmptyMethod: Put empty method definitions on a single line.def m(foo:1, bar:2) ...^^^^^^^^^^^^^^^^^^^example.rb:3:10: C: Layout/SpaceAfterColon: Space missing after colon.def m(foo:1, bar:2) ^example.rb:3:17: C: Layout/SpaceAfterColon: Space missing after colon.def m(foo:1, bar:2) ^1 file inspected, 3 offenses detected
It can not be detected when Layout/SpaceAfterColon is disabled.
% cat .rubocop.ymlLayout/SpaceAfterColon: Enabled: false
% rubocopInspecting 1 fileCOffenses:example.rb:3:1: C: Style/EmptyMethod: Put empty method definitions on a single line.def m(foo:1, bar:2) ...^^^^^^^^^^^^^^^^^^^1 file inspected, 1 offense detected
So Layout/SpaceAfterColon cop cannot be removed as it works.
Is your feature request related to a problem? Please describe.
The
Layout/SpaceAfterColon
, checks space needed between colon and value in ruby 1.9 hash syntax. It's already check with Layout/AlignHash.Each style describe in this latter cop guarantee at least one space between separators and values.
Also since #6649 release in 0.70.0 (2019-05-21), user can choose multiple alignement style, reinforcing the feeling than the
Layout/SpaceAfterColon
cop is become useless.Describe the solution you'd like
Remove this cop which has become useless.
What do you think ?
The text was updated successfully, but these errors were encountered: