-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Comment out infer_spec_type_from_file_location!
in generated helper.
#2804
Conversation
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.
Lgtm
8af9748
to
efca529
Compare
Released in 7.1.0 |
Out of curiosity, @JonRowe: What is the reasoning behind the recommendation to tag specs manually over inferring from location? |
A combination of factors, it is better to be explicit about things to improve the "documentation" effect, it makes it less surprising when you include extra helpers into different types of specs and its less brittle as an implementation. |
I think this really goes against the naming conventions that Rails instills. |
Rails doesn't automatically configure things based on directories either, you inherit from classes e.g. |
At the time this cop was added, [it was noted][PR Comment] that this was legacy behavior left as the default for people migrating to RSpec 3. Now RSpec 7.1.0 has [removed this default][PR] to make it clear that this is deprecated / legacy behavior, let's delete this cop. [PR Comment]: rubocop/rubocop-rspec#1365 (comment) [PR]: rspec/rspec-rails#2804
At the time this cop was added, [it was noted][PR Comment] that this was legacy behavior left as the default for people migrating to RSpec 3. Now RSpec 7.1.0 has [removed this default][PR] to make it clear that this is deprecated / legacy behavior, let's delete this cop. [PR Comment]: rubocop/rubocop-rspec#1365 (comment) [PR]: rspec/rspec-rails#2804
At the time this cop was added, [it was noted][PR Comment] that this was legacy behavior left as the default for people migrating to RSpec 3. Now RSpec 7.1.0 has [removed this default][PR] to make it clear that this is deprecated / legacy behavior, let's delete this cop. [PR Comment]: rubocop/rubocop-rspec#1365 (comment) [PR]: rspec/rspec-rails#2804
At the time this cop was added, [it was noted][PR Comment] that this was legacy behavior left as the default for people migrating to RSpec 3. Now RSpec 7.1.0 has [removed this default][PR] to make it clear that this is deprecated / legacy behavior, let's delete this cop. [PR Comment]: rubocop/rubocop-rspec#1365 (comment) [PR]: rspec/rspec-rails#2804
I think it goes against the convention over configuration part of the doctrine. Maybe that's what @BenMorganMY wanted to talk about. |
@fonji yep, this is primarily about ensuring convention over configuration. It's redundant for a Rails application to also have to specify the spec type and will end up encouraging bad configuration behaviour. This should not be the default in a Rails application. |
We would prefer that people tag their specs manually (or via generators) and whilst our generators do generate tags we never removed the generated
infer_spec_type_from_file_location!
as a default.Fixes #2803