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

Update Layout/HashAlignment to use ignore_implicit #216

Closed
jmkoni opened this issue Oct 26, 2020 · 4 comments · Fixed by rubocop/rubocop#9798 or #296
Closed

Update Layout/HashAlignment to use ignore_implicit #216

jmkoni opened this issue Oct 26, 2020 · 4 comments · Fixed by rubocop/rubocop#9798 or #296
Labels

Comments

@jmkoni
Copy link
Contributor

jmkoni commented Oct 26, 2020

Right now, if key value pairs are sent as arguments, we are reading it as a hash, not arguments, and treating it as such. That means we get formatting like this:

update(foo: bar,
       baz: boo,
       pony: party)

when what we want is:

update(foo: bar,
  baz: boo,
  pony: party
)
@jmkoni jmkoni self-assigned this Oct 26, 2020
@searls searls added approved 👍 rule change 👩‍⚖️ Suggest a style guide rule change labels Oct 26, 2020
@jmkoni
Copy link
Contributor Author

jmkoni commented Oct 29, 2020

Ok, maybe not. I changed this setting and these were the results:
in autocorrectable-bad, I added:

do_stuff(a: 1,
                     b: 2,
                     c: 3
                    )

which corrected to:

    do_stuff(a: 1,
                       b: 2,
                       c: 3)

which is not ideal.
Then this one also didn't get corrected anymore:

config.fog_credentials_as_kwargs(
      provider:              "AWS",
      aws_access_key_id:     ENV["S3_ACCESS_KEY"],
      aws_secret_access_key: ENV["S3_SECRET"],
      region:                ENV["S3_REGION"]
    )

I think we'd need a new rubocop option in order to fully fix this. TBD on what that should be.

@jmkoni
Copy link
Contributor Author

jmkoni commented Nov 2, 2020

Gonna unassign this in case someone else feels like taking this on in the meantime :)

@jmkoni jmkoni removed their assignment Nov 2, 2020
@jmkoni jmkoni added the blocked label Jan 22, 2021
koic added a commit to koic/rubocop that referenced this issue May 15, 2021
This PR makes `Layout/ArgumentAlignment` aware of kwargs and
fixes standardrb/standard#216.
@koic
Copy link
Contributor

koic commented May 15, 2021

This looks like a false negative for Layout/ArgumentAlignment. I've opened rubocop/rubocop#9798.

bbatsov pushed a commit to rubocop/rubocop that referenced this issue May 15, 2021
This PR makes `Layout/ArgumentAlignment` aware of kwargs and
fixes standardrb/standard#216.
@searls
Copy link
Contributor

searls commented May 15, 2021

And it's already merged! You're amazing, @koic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants