Comments (16)
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.
I think not to check is the best practice...
from rubocop-rails.
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.
@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.
@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.
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.
Isn't referrer
the only correct spelling of the word? :-) Yeah, guess we can have a cop for this. PR welcome!
from rubocop-rails.
Haha, well technically speaking... https://en.wikipedia.org/wiki/HTTP_referer#Etymology
from rubocop-rails.
Good to know! :-)
from rubocop-rails.
@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.
@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.
I could see it being a configurable cop, though, so people can pick their flavor.
from rubocop-rails.
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.
Nice, thanks!
from rubocop-rails.
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.
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 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.
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)
- No `#minimum_target_rails_version` for some cops HOT 1
- Outdated note for the `Rails/ContentTag` cop
- Cop idea: Redundant #alias_attribute for associations HOT 2
- Rails/WhereNot raises an error
- Error while Rails/UniqueValidationWithoutIndex cop was inspecting HOT 3
- Use ActiveSupport DateAndTime predicates HOT 1
- `Rails/SaveBang` does not work with instance variables HOT 1
- `Rails/Savebang` fails when `persisted?` is checked on a broader expression
- `Rails/ReversibleMigrationMethodDefinition` false positive when `up` and `down` defined as class methods HOT 1
- Incorrect autocorrect for `Rails/FindBy` cop
- Cop suggestion: disallow `return` in tests HOT 2
- Cop to detect deprecated enums with keyword arguments HOT 3
- `Rails/UniqueValidationWithoutIndex` should not fail when have index HOT 1
- False Positive for `Rails/ActionControllerFlashBeforeRender` when flash is called in a case statement
- False positive for `Rails/ActionControllerFlashBeforeRender` when using `return redirect_to`
- Error occurred with `ActiveRecord::ModelSchema::ClassMethods#ignored_columns=`
- Please remove `Rails/UnusedIgnoredColumns` HOT 1
- Error occurred for `Rails/Present` was auto correcting HOT 2
- Rubocop significantly slower on Rails 7.1
- New cop that detects foreign key-like columns with incorrect types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubocop-rails.