Skip to content

Conversation

@natesholland
Copy link
Contributor

In #548 I upgraded RuboCop by about 10 versions. In this PR I'm following up to upgrade to the latest version of RuboCop. All the changes in this PR are a result of the auto-correct flags so I didn't edit any code manually.

There are two specific items that I want to call out in this PR:

  • First is that rubocop-performance is now its own gem that can be found here https://github.com/rubocop-hq/rubocop-performance. I suspect that we still want the performance cops to keep this project as performant as possible. Therefore I pulled the gem in and required the performance cops to keep them running. I tested to ensure that we are in fact still running performance cops.
  • For Layout/AlignHash I had to make a call on which style to prefer. I personally like the table formatting, but I'm happy to change it to a different format based on what the maintainers want. The documentation for the three format options are here https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/AlignHash. I like table and then key and then I think `separator is clearly the weirdest and worst.

This is the latest version of rubocop with most of the auto-corrects
run. There are a few notes on this:
- Performance cops have been refactored out so they require being
installed in a new gem. That gem has been included so that we can keep
performance cops.
- I left out the Alight Hash cop because the code base has it going both
ways. I want to put that in its own commit so that it is easy to change
or reverse if the maintainers want to go one way or another.
.rubocop.yml Outdated
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Layout/AlignHash:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this at the before Layout/DotPosition (so that they are alphabetically sorted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and rebased.

Copy link
Member

@ixti ixti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than rubocop config order, LGTM.

This commit enables Layout/AlignHash and sets the prefered format to the
table format. The docs for this cop can be found here:
https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/AlignHash
@natesholland natesholland force-pushed the natesholland/rubocop_upgrade_0_68 branch from bc4627e to 90f8213 Compare May 9, 2019 00:41
@natesholland
Copy link
Contributor Author

@ixti done and ready to go.

@ixti ixti merged commit 6240672 into httprb:master May 9, 2019
@ixti
Copy link
Member

ixti commented May 9, 2019

Thank you!

@natesholland natesholland deleted the natesholland/rubocop_upgrade_0_68 branch May 9, 2019 01:50
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.

2 participants