-
Notifications
You must be signed in to change notification settings - Fork 47
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
Remove DisabledByDefault #220
Conversation
Should this be a 2.0 release? |
@@ -1,7 +1,6 @@ | |||
AllCops: | |||
Exclude: | |||
- 'db/schema.rb' | |||
DisabledByDefault: true |
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.
If we're removing this, we probably want to switch to explicitly disabling all existing rules that we haven't already got an entry for.
That way, we're only changing the behaviour going forward, instead of mass enabling rules on consumer repos.
Basically what you've done for Gemspec/RequiredRubyVersion
, but we need to cover all the other rules which we might not detect this repo violating. Not sure if there's an easy way to list out all those rules though.
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.
This feels overly paranoid to me. It makes more sense to bump the major version (2.0
) and say “breaking change, watch out” with tips on how to deal with it. I don't think blanket trying to hide 10's or 100's of Cops is the answer and defeats the purpose of this change.
It should be up to each project which cops to ignore or fix, just as what was done in this PR.
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.
Can we test this out on a substantial project before release, to better understand what the upgrade process will involve?
And also maybe add an upgrade guide in the wiki here?
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.
Users of this gem should not need to make any decisions about cops. This gem is a style guide which means that all apps should be using the same set of rules, not making decisions witch ones enable or disabled. This means that this gems needs to disable all cops that we want disabled and enable all cops we want enabled. Just removing this config is not enough.
Also please don’t change the string quotes.
As a first step, I've reverted the quotation changes and disabled that cop. There is an ongoing discussion (which I believe @sambostock will be sharing details on) about next steps. On reflection, I agree with your statement @rafaelfranca and it shouldn't be the responsibility of downstream projects (namely core) to decide which cops to enable/disable. This change alone is not adequate. |
If I'm interpreting it correctly, it sounds like we're all agreed on the following problem
and the following improvement
It sounds like what needs discussion is how we proceed with respect to new cops: Alternative: Remove
|
I thought about this problem a lot more over the holidays and I'm not sure this PR is the right thing to do at all. Rather, I think the problem might lie with documentation around being transparent about what this gem does (disabling all cops by default) and explaining how to add extensions like I concur with the purpose of this gem, which is for Shopify as an organization to be opinionated about the style of Ruby we write. We should maybe be equally opinionated about adding additional extensions. So, provided there are no major objections to this approach, I'll draft up a documentation change to reflect this. I think this should probably lie in the gem's documentation but perhaps there should be a note in the main style guide too? |
09105e8
to
5b5db2d
Compare
I agree with all the points from @rafaelfranca, but I also understand the pain that users of multiple configs might be experiencing since |
5b5db2d
to
d004ac4
Compare
With Rubocop now using semantic versioning, and thereby setting a clear boundary when pending cops become enabled by default, it doesn't make sense to keep this configuration option. See: https://docs.rubocop.org/rubocop/versioning.html Users of this gem will now get warnings about all previously disabled by default cops. They will either need to generate TODO lists using Rubocop, fix the violations, or manually configure rules they wish to ignore. Consumers of the gem should also be aware of the NewCops configuration to enable or disable new, pending cops by default and thereby somewhat retaining the old behaviour.
d004ac4
to
2cbfcb4
Compare
With Rubocop now using semantic versioning, and thereby setting a clear boundary when pending cops become enabled by default, it doesn't make sense to keep this configuration option.
See: https://docs.rubocop.org/rubocop/versioning.html
Users of this gem will now get warnings about all previously disabled by default cops. They will either need to generate TODO lists using Rubocop, fix the violations, or manually configure rules they wish to ignore.
Consumers of the gem should also be aware of the NewCops configuration to enable or disable new, pending cops by default and thereby somewhat retaining the old behaviour.