Giter Site home page Giter Site logo

Comments (16)

leewaa avatar leewaa commented on May 17, 2024 9

Old issue I know however, this one killed my flow 😂 a cop against something like this is imho, useless! and it wants the incorrect spelling of the word.

The correct spelling is referrer !

from rubocop-rails.

whchi avatar whchi commented on May 17, 2024 1

I think not to check is the best practice...

from rubocop-rails.

leewaa avatar leewaa commented on May 17, 2024 1

I still can't believe that a cop like this even exists. Rubocop is a great concept, but the devs are taking it way to far with this one 😜

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024 1

@leewaa you know you can disable rules that aren't useful to you, right? You can also configure it to your preferred spelling. I've been happy with this rule. Having inconsistent spelling makes it harder to grep for references.

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024 1

@leewaa the reason it's enforcing a misspelling is because that is the way it is in the spec. There's nothing forcing you to do it that way in your codebase, but it's not "wrong" to follow the spec. It's perfectly reasonable to stick with the misspelling, since that's more consistent with most other places in the stack, including your browser.

referer

Take your pick, but to me its six of one and half a dozen of the other. It certainly doesn't seem worth fussing over one way or the other.

from rubocop-rails.

bbatsov avatar bbatsov commented on May 17, 2024

Isn't referrer the only correct spelling of the word? :-) Yeah, guess we can have a cop for this. PR welcome!

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024

Haha, well technically speaking... https://en.wikipedia.org/wiki/HTTP_referer#Etymology

from rubocop-rails.

bbatsov avatar bbatsov commented on May 17, 2024

Good to know! :-)

from rubocop-rails.

rrosenblum avatar rrosenblum commented on May 17, 2024

@mockdeep, based on the wiki article, this is quite interesting. It appears that the misspelling has become the standard. It raises an interesting question of if referer or referrer should be used. I wonder which spelling other common libraries and frameworks prefer.

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024

@rrosenblum something tells me it isn't very consistently spelled anywhere, though I think we'd go with referer in our codebase just for consistency with the spec.

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024

I could see it being a configurable cop, though, so people can pick their flavor.

from rubocop-rails.

rrosenblum avatar rrosenblum commented on May 17, 2024

I think we'd go with referer in our codebase
I could see it being a configurable cop

I was thinking the same things.

from rubocop-rails.

mockdeep avatar mockdeep commented on May 17, 2024

Nice, thanks!

from rubocop-rails.

bquorning avatar bquorning commented on May 17, 2024

Oh, the confusion: https://www.w3.org/TR/html5/links.html#link-type-noreferrer 😆

[…] the user agent must not include a Referer (sic) HTTP header […]

from rubocop-rails.

leewaa avatar leewaa commented on May 17, 2024

Yes, configuration is a must since everyone runs their own coding style / conventions and the default doesn't suit everyones needs.

I kinda get the reasoning to why this exists, however enforcing the incorrect spelling of a word per default is wrong 😄

from rubocop-rails.

leewaa avatar leewaa commented on May 17, 2024

@leewaa the reason it's enforcing a misspelling is because that is the way it is in the spec. There's nothing forcing you to do it that way in your codebase, but it's not "wrong" to follow the spec. It's perfectly reasonable to stick with the misspelling, since that's more consistent with most other places in the stack, including your browser.

referer

Take your pick, but to me its six of one and half a dozen of the other. It certainly doesn't seem worth fussing over one way or the other.

Thanks for your time, appreciate it. I am already aware of the history, something I had looked into before commenting on this back in 2019. It's actually what makes this so much worse for me 🙈. Why are we still plagued to continue with incorrectly spelling the word, and then even enforcing it per default. I find this is moving in the wrong direction. Just because it's in the spec, doesn't mean we have to cover for that. We already accept either spelling in rails, so why not choose the correct spelling as default?

Anyway Ill stop here, as you said it's not really worth the fuss, though I do like healthy discussion.

from rubocop-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.