Skip to content

Conversation

@jterapin
Copy link
Contributor

Description of changes:
Changes made to the library to be up to date with Ruby Style Guide with a help of rubocop.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

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

Nice - looking good! So many double quotes....

.rubocop.yml Outdated
Enabled: false

Metrics/LineLength:
Enabled: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Our other projects have traditionally set this at 80 (though personally I prefer 120). If we set it to 80 or 120, how many violations does that add?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like 80 because I can have three windows on my monitor and not have horizontal scrolling. I'm ok with 120 if it's overly burdensome, but I think most of the library is already 80

Copy link
Contributor Author

@jterapin jterapin Jan 27, 2023

Choose a reason for hiding this comment

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

Thanks y'all for the inputs. I went with 120 max, since I was encountering 150+ more offenses with 80 max.


@items.each { |item| yield item }
@items.each do |item|
yield item
Copy link
Contributor

Choose a reason for hiding this comment

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

slightly inconsistent style between yield(batch) and yield item. I think I'd lean towards calling with the parens here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated for consistency. TY!

.rubocop.yml Outdated
Enabled: false

Metrics/MethodLength:
Max: 50
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit arbitrary here - I think I'd actually lean towards just disabling.

Copy link
Contributor

Choose a reason for hiding this comment

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

For one off cases, you can add inline comment to disable cops

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with disabling altogether as there quite a few...! Thanks!

.rubocop.yml Outdated
- 'spec/**/*'

Style/SymbolArray:
EnforcedStyle: brackets
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these styles? I think as much as possible I'd lean towards rubocop defaults. Or does this syntax break something else?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also prefer defaults (can't thumbs up from mobile)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

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

LGTM - Great cleanups!

@jterapin jterapin marked this pull request as ready for review January 27, 2023 19:01
@jterapin jterapin merged commit 445de8e into main Jan 27, 2023
@jterapin jterapin deleted the rubocop branch January 27, 2023 19:06
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.

3 participants