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

upgrade rubocop and rubocop-performance #298

Closed
wants to merge 1 commit into from

Conversation

jmkoni
Copy link
Contributor

@jmkoni jmkoni commented May 17, 2021

Was too quick initially. It looks like, with this upgrade, we are seeing the Layout/HashAlignment now look as though we are using EnforcedColonStyle: table instead of key. This is the diff of what it is correcting to to what it should be correcting to in our tests:

<     hi: "neat"
---
>   hi: "neat"
68,71c68,71
<     thing_1:           0,
<      thing_2:           1,
<      longer_thing:      2,
<      even_longer_thing: 3
---
>     thing_1: 0,
>     thing_2: 1,
>     longer_thing: 2,
>     even_longer_thing: 3
76,77c76,77
<       provider:              "AWS",
<       aws_access_key_id:     ENV["S3_ACCESS_KEY"],
---
>       provider: "AWS",
>       aws_access_key_id: ENV["S3_ACCESS_KEY"],
79c79
<       region:                ENV["S3_REGION"]
---
>       region: ENV["S3_REGION"]
83,84c83,84
<       provider:              "AWS",
<       aws_access_key_id:     ENV["S3_ACCESS_KEY"],
---
>       provider: "AWS",
>       aws_access_key_id: ENV["S3_ACCESS_KEY"],
86c86
<       region:                ENV["S3_REGION"]
---
>       region: ENV["S3_REGION"]

@jmkoni
Copy link
Contributor Author

jmkoni commented May 17, 2021

@koic we have a few oddities with hashes in the recent upgrade. After autocorrecting https://github.com/testdouble/standard/blob/main/test/fixture/cli/autocorrectable-bad.rb

This:

THINGS = {
    :oh => :io,
    :hi => 'neat',
    }

gets changed to:

THINGS = {
 oh: :io,
   hi: "neat"
}

this:

  enum event_type: {
     thing_1:           0,
     thing_2:           1,
     longer_thing:      2,
     even_longer_thing: 3,
  }

becomes

  enum event_type: {
    thing_1:           0,
     thing_2:           1,
     longer_thing:      2,
     even_longer_thing: 3
  }

and another hash looks as if we have EnforcedColonStyle set to table instead of key. I didn't notice anything that would cause this in https://github.com/rubocop/rubocop/pull/9798/files, but I'm hoping you might be able to tell what's going on :)

@koic
Copy link
Contributor

koic commented May 17, 2021

Oops! This is a bug caused by my patch. I've opened rubocop/rubocop#9805 to fix this issue 💦

@jmkoni
Copy link
Contributor Author

jmkoni commented May 17, 2021

@koic thank you for being so quick! 🙇🏽‍♀️

@jmkoni jmkoni closed this Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants