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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails/HttpStatus - disable cop #363
Conversation
numeric status codes are explicit, symbols just add an extra lookup
Alternative proposal in this comment: Don't disable the cop, switch the preferred style to numeric, making Please vote on what you prefer with +1 or -1 on this comment. |
@himdel honestly with the addendum comment, this is pretty confusing as people have voted, since some have voted in both comments and the original post. However, I see those two options as mutually exclusive and it is uncertain what vote counts for what. Personally, I think polling should be done in a single spot (though I guess I am indifferent if you use talk.manageiq.org or something else), but don't split the decision between two comments. Example: What I did here for array literals: #333 I personally voted for going with enforcing But the above is also why your voting system is unclear as it is hard to tell if what you have is:
or
or something else entirely... |
..Yeah, sorry about that, but I think it doesn't have to be mutually exclusive: parse the root comment as "do I want rubocop to NOT complain when I use numbers?", |
Either way, looking at the current code: manageiq-ui-classic: manageiq-api: |
@himdel If you haven't already can you create a talk article linking back to this issue? That way devs that don't follow guides can at least find out about this vote. |
Good idea, thanks :) (Also updated the PR to switch to |
consistency good, symbolic bad :)
Looks like there is agreement to enforce numeric, so I'm going to merge this. |
Proposing to disable the Rails/HttpStatus cop
The current setting for the cop is to prefer symbols, which means:
I consider the numeric codes more readable and clearer,
but would not go as far as forcing people to use them.
(Translation table between actual status codes and rails symbols: https://guides.rubyonrails.org/layouts_and_rendering.html#the-status-option)
=> just disabling the cop in this PR
Please vote on what you prefer with 馃憤 or 馃憥 on this comment. (馃憤 means disable the cop, 馃憥 means
:status => :ok
is the only right way)