makandra / makandra-rubocop

makandra's default Rubocop configuration
MIT License
6 stars 1 forks source link

Change Rails/RequestReferer from `referer` to `referrer` #34

Closed denzelem closed 2 years ago

denzelem commented 2 years ago

Docs: https://www.rubydoc.info/gems/rubocop/0.49.1/RuboCop/Cop/Rails/RequestReferer

Current configuration (default from https://github.com/rubocop/rubocop-rails)

Rails/RequestReferer:
  Description: 'Use consistent syntax for request.referer.'
  Enabled: true
  VersionAdded: '0.41'
  EnforcedStyle: referer
  SupportedStyles:
    - referer
    - referrer

Suggested EnforcedStyle

EnforcedStyle: referrer

Background: When you use referer, it would represent the actual naming of the misspelled header. I would argue, that this is nothing we need to take care of when calling request.referrer.

Example where it looks strange to me, but would be the preferred style right now:

referrer = request.referer

Please vote with 👎🏼 to keep the current config or with 👍🏼 to change the config.

triskweline commented 2 years ago

Both spellings are valid. Vote to disable the cop.