-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Release 2.0 #1055
Release 2.0 #1055
Conversation
To avoid name and department clash issues, RuboCop decided to grant each extension its own department. For those cops that already have the department matching the extension name, no changes are needed. More info rubocop/rubocop#8490 The changed cop names are: * `Capybara/CurrentPathExpectation` -> `RSpec/Capybara/CurrentPathExpectation` * `Capybara/FeatureMethods` -> `RSpec/Capybara/FeatureMethods` * `Capybara/VisibilityMatcher` -> `RSpec/Capybara/VisibilityMatcher` * `FactoryBot/AttributeDefinedStatically` -> `RSpec/FactoryBot/AttributeDefinedStatically` * `FactoryBot/CreateList` -> `RSpec/FactoryBot/CreateList` * `FactoryBot/FactoryClassName` -> `RSpec/FactoryBot/FactoryClassName` * `Rails/HttpStatus` -> `RSpec/Rails/HttpStatus`
Add an uber-department
Release v2.0.0-pre, compatible with RuboCop v1.0
Only dots are used when separating versions in Rubygems.
Why? - it was slow #925 (comment) - it ignored non-describe top-level example groups #925 (comment) `TopLevelGroup` is a modern replacement for `TopLevelDescribe`. Examples how to migrate cops from TopLevelDescribe to TopLevelGroup: - #932 - #977
Remove old Cop baseclass
Retire TopLevelDescribe
Retire RSpec/InvalidPredicateMatcher
I have taken a look at the remaining pull requests before 2.0, and tried to put them in order:
|
Would you like me to take a stab at rebasing #942? |
It looks like there will only be conflicts in lib/rubocop/rspec/top_level_group.rb and lib/rubocop/rspec/variable.rb. It looks like minor stuff. I think it’s still worth it to work in parallel. You take #956, I take #942. |
Sounds good 👍 |
This moves several files to a new `mixins/` folder. I was going to add some new macros, per [this comment][1], but thought it might clutter things up a bit to put them in the root folder. I thought of adding a `macros/` folder, but decided to emulate the [rubocop source][2] instead. [1]: #934 (comment) [2]: https://github.com/rubocop-hq/rubocop/tree/master/lib/rubocop/cop/mixin
* Add shared context for all cop specs. * Remove redundant `config` metadata for cop specs. * Remove redundant `cop` subjects from cop specs.
Fix find_all_in_scope method docs
Add mixins folder
Use config context for all cop specs
@pirj I wish GitHub offered a way of communicating 1:1, synchronously 😄 I’ll try signing onto gitter.im, you can catch me there if you want. |
'autocorrect' shared example group does not pass a correct file name to the cop, and if this cop is tweaked to only inspect factories, this spec fails because the default file name/path is skipped, since it's not a factory path.
Refactor a spec
lib/rubocop/cop/rspec/multiple_expectations.rb:73:32: W: Lint/ToEnumArguments: Ensure you correctly provided all the arguments. expectations_count = to_enum(:find_expectation, node).count ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We'd still love to use OUR new cops while working on our codebase, let's see how this option works when set under RSpec namespace when we introduce the first pending cop.
Stop using newly added cops
Remove relevance detection code
RSpec aliases runtime matchers
The customization is now made via .rubocop.yml configuration, i.e.: RSpec: Language: Includes: Example: - it_has_special_behavior
…tomization Drop RSpec/EmptyExampleGroup customization
Enable pending cop(s)
It reads nicer, and `flog` agrees. Before: ❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb 29.7: flog total 5.0: flog/method average 9.8: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:36-44 7.6: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-16 4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:20-22 After: ❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb 25.8: flog total 4.3: flog/method average 7.2: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:35-44 6.3: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-15 4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:19-21
Add v2 update docs
Use `case` instead of `if`
I added a commit to bump the version number to 2.0.0. Are we ready? Are there any easy-peasy bugfix PRs that we want to also merge in? Should we link to @pirj ’s upgrade document (presumably on https://docs.rubocop.org/rubocop-rspec/2.0/upgrade_to_version_2.html ) directly from the changelog too? |
Great idea!
YES! 🚀 🙌 |
I guess this should be fixed first |
- Add explicit dependency on rubocop-ast >= 1.1.0. - Rename the "Change log" to "Changelog". - Remove mention of "potentially breaking" changes. All changes between 1.x and 2.0 should be regarded as potentially breaking, so no need to highlight one over the rest. - Link to the upgrade document from README.
f4b3785
to
056ee5a
Compare
@Darhazer, green light for the release? |
I trust you @pirj and @bquorning on this one. Release at your will and thank you for the hard work to make it happen 🎉 |
Did I miss anything? Except saying a bit thank you to everyone who helped getting us this far. |
Awesome! Congrats with the release, guys! |
Closed a dozen tickets, mostly thanks to #956 🎉 |
Prepare for a 2.0 release.
This PR is to track the changes in
release-2.0
branch, which is purposed to integrate remaining PRs targeted for 2.0.