Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add an option to Layout/ExtraSpacing rule for table aligned arguments #5657

Open
mdesantis opened this issue Mar 9, 2018 · 6 comments

Comments

@mdesantis
Copy link

mdesantis commented Mar 9, 2018

I have this Rails migration:

class CreateUsers < ActiveRecord::Migration[5.2]
  def change
    create_table :users do |t|
      t.citext :email,           null: false, index: { unique: true }
      t.citext :username,                     index: { unique: true }
      t.string :password_digest, null: false

      t.timestamps
    end
  end
end

Layout/ExtraSpacing complains on t.citext :email, null: false, index: { unique: true } line because there's too much space; but I like how they are aligned. I'd love if Layout/ExtraSpacing rule had some kind of AllowTableStyleArgumentsAlignment option in order to allow this kind of alignment.

Expected behavior

t.citext :email, null: false, index: { unique: true } line in the example above shouldn't complain if some kind of AllowTableStyleArgumentsAlignment option is enabled

Actual behavior

t.citext :email, null: false, index: { unique: true } line raises Layout/ExtraSpacing rule violation


RuboCop version

> rubocop -V
0.53.0 (using Parser 2.5.0.3, running on ruby 2.4.2 x86_64-linux)
@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@mvastola
Copy link

Hi, I would just like to second this. This is a major source of annoyance for me and I wish there were some way to have rubocop recognize parameters intentionally aligned this way.

@stale stale bot removed the stale Issues that haven't been active in a while label May 27, 2019
@esambo
Copy link

esambo commented Aug 18, 2019

Possibly related to #2035

@stale
Copy link

stale bot commented Feb 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label Feb 14, 2020
@stale
Copy link

stale bot commented May 14, 2020

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed May 14, 2020
@hkmaly
Copy link

hkmaly commented Oct 12, 2021

Reopen HOW?

@koic koic reopened this Oct 12, 2021
@koic koic removed the stale Issues that haven't been active in a while label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants