-
Notifications
You must be signed in to change notification settings - Fork 43
Update library syntax #129
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
Conversation
alextwoods
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
lib/aws-record/record/batch_read.rb
Outdated
|
|
||
| @items.each { |item| yield item } | ||
| @items.each do |item| | ||
| yield item |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
alextwoods
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Great cleanups!
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.