Skip to content
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

Merged
merged 37 commits into from Nov 6, 2020
Merged

Release 2.0 #1055

merged 37 commits into from Nov 6, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented Oct 22, 2020

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.

bquorning and others added 5 commits October 21, 2020 22:54
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`
Release v2.0.0-pre, compatible with RuboCop v1.0
@pirj pirj added this to the 2.0 milestone Oct 22, 2020
bquorning and others added 6 commits October 22, 2020 20:38
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
lib/rubocop/rspec/version.rb Outdated Show resolved Hide resolved
@bquorning
Copy link
Collaborator

bquorning commented Oct 22, 2020

I have taken a look at the remaining pull requests before 2.0, and tried to put them in order:

@pirj
Copy link
Member Author

pirj commented Oct 22, 2020

Awesome!

I can take care of making final touches to #956. I really hope it doesn't interfere with #942 😱

@bquorning
Copy link
Collaborator

Would you like me to take a stab at rebasing #942?

@bquorning
Copy link
Collaborator

I can take care of making final touches to #956. I really hope it doesn't interfere with #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.

@pirj
Copy link
Member Author

pirj commented Oct 22, 2020

Sounds good 👍

mockdeep and others added 6 commits October 22, 2020 23:39
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.
@bquorning
Copy link
Collaborator

@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.

pirj and others added 4 commits October 28, 2020 01:25
'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.
    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.
bquorning and others added 13 commits October 29, 2020 12:58
The customization is now made via .rubocop.yml configuration, i.e.:

    RSpec:
      Language:
        Includes:
          Example:
          - it_has_special_behavior
…tomization

Drop RSpec/EmptyExampleGroup customization
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
@bquorning
Copy link
Collaborator

bquorning commented Nov 5, 2020

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?

@pirj
Copy link
Member Author

pirj commented Nov 5, 2020

Should we link to @pirj ’s upgrade document

Great idea!

Are we ready?

YES! 🚀 🙌

@Darhazer
Copy link
Member

Darhazer commented Nov 5, 2020

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.
@pirj
Copy link
Member Author

pirj commented Nov 6, 2020

@Darhazer, green light for the release?

@pirj
Copy link
Member Author

pirj commented Nov 6, 2020

Hey @backus!

Summoning you not only to notify you about an upcoming major version release of a child of yours.
We seem to lack CodeClimate keys, do you mind to invite @bquorning, @Darhazer and myself @pirj there as collaborators?

@Darhazer
Copy link
Member

Darhazer commented Nov 6, 2020

@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 🎉

@bquorning bquorning merged commit c3fa5ba into master Nov 6, 2020
@bquorning bquorning deleted the release-2.0 branch November 6, 2020 16:20
@bquorning
Copy link
Collaborator

Did I miss anything? Except saying a bit thank you to everyone who helped getting us this far.

@pirj
Copy link
Member Author

pirj commented Nov 6, 2020

Awesome! Congrats with the release, guys!

@pirj
Copy link
Member Author

pirj commented Nov 6, 2020

Closed a dozen tickets, mostly thanks to #956 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants