-
Notifications
You must be signed in to change notification settings - Fork 498
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
AO3-5758 Add Hound rules for bundler, layout, and style #3641
Changes from all commits
42c730a
b8de976
2ae9728
11a1628
98dcfc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,18 @@ | |||||||
AllCops: | ||||||||
TargetRubyVersion: 2.6 | ||||||||
|
||||||||
Bundler/OrderedGems: | ||||||||
Enabled: false | ||||||||
|
||||||||
Layout/DotPosition: | ||||||||
EnforcedStyle: leading | ||||||||
|
||||||||
Layout/IndentArray: | ||||||||
EnforcedStyle: consistent | ||||||||
|
||||||||
Layout/MultilineMethodCallIndentation: | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With these 2 layout rules, Hound will ask us to rewrite, for example: otwarchive/app/controllers/api/v2/bookmarks_controller.rb Lines 64 to 66 in 67b7b14
into: archivist_bookmarks = archivist_bookmarks
.select { |b| b&.bookmarkable.is_a?(ExternalWork) ? b&.bookmarkable&.url == current_bookmark_url : false }
.map { |b| [b, b.bookmarkable] } There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we do this? I think we use the first style more than the second. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can switch to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, I really don't know what the thing to do here is! I do see a benefit to using what you've put here -- less indenting means more room for your line of code, which is nice. However, I was under the impression we've mainly used the first approach over the years, which would mean getting a lot more Hound complaints as we edit stuff. So I really am asking, does my perception of what we've been doing align with others', and if so, should we make this change anyway? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the leading indentation, but I've also always been a trailing dot person - when we started the project, we were still on Ruby 1.8, which didn't even allow the leading dot syntax. So there's got to be a lot of that in the codebase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Easier copying and pasting to the console is a good point and makes me lean even more strongly toward sticking with trailing, as does the note about comments in rubocop/ruby-style-guide#176 (comment). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...however, upon further thought, if we switch our indenting to plain old
vs
But if we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we have 2 options:
I like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer 1 as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's 🐹 this at 1, then! |
||||||||
EnforcedStyle: indented | ||||||||
|
||||||||
Layout/TrailingWhitespace: | ||||||||
Enabled: false | ||||||||
|
||||||||
|
@@ -28,10 +40,21 @@ Metrics/ModuleLength: | |||||||
Style/FormatStringToken: | ||||||||
EnforcedStyle: template | ||||||||
|
||||||||
Style/FrozenStringLiteralComment: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/GlobalVars: | ||||||||
AllowedVariables: | ||||||||
- $elasticsearch | ||||||||
- $rollout | ||||||||
|
||||||||
# stop checking if uses of "self" are redundant | ||||||||
Style/RedundantSelf: | ||||||||
Enabled: false | ||||||||
|
||||||||
# stop checking quotation marks | ||||||||
Style/StringLiterals: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/SymbolArray: | ||||||||
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.