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

Stop using newly added cops #1065

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Stop using newly added cops #1065

merged 1 commit into from
Oct 28, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented Oct 28, 2020

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
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

(source)

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.


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • [-] Updated documentation.
  • [-] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

    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.
@pirj pirj self-assigned this Oct 28, 2020
@pirj pirj mentioned this pull request Oct 28, 2020
@pirj
Copy link
Member Author

pirj commented Oct 28, 2020

@bquorning Merge at will.

@bquorning bquorning merged commit d0588f2 into release-2.0 Oct 28, 2020
@bquorning bquorning deleted the stop-using-edge-cops branch October 28, 2020 10:52
@bquorning
Copy link
Collaborator

Lint/ToEnumArguments: Ensure you correctly provided all the arguments.

I ran into this again recently. I think it’s actually a bug – see also rubocop/rubocop#8941 (comment)

@bquorning
Copy link
Collaborator

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.

It doesn’t work.

Warning: RSpec does not support NewCops parameter.

Supported parameters are:

  - Enabled
  - StyleGuideBaseURL
  - Include
  - Language

@pirj
Copy link
Member Author

pirj commented Jun 21, 2022

What if we define NewCops: pending in config/default.yml under RSpec like rubocop does in its config/default.yml?

This could fix the error, but I'm still uncertain if it would work as intended.

Another concern is if changing the root NewCops in project's .rubocop.yml would affect RSpec/NewCops. It feels that it should, but again I'm uncertain.

@bquorning
Copy link
Collaborator

What if we define NewCops: pending in config/default.yml under RSpec like rubocop does in its config/default.yml?

Nope, that doesn’t work :sad_panda:

@pirj
Copy link
Member Author

pirj commented Jun 21, 2022

This is quite frustrating, we can't eat our own dogfood 😄

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.

2 participants