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

Fix multiple cops to detect let with proc argument #904

Merged
merged 1 commit into from Apr 29, 2020

Conversation

tejasbubane
Copy link
Contributor

@tejasbubane tejasbubane commented Apr 29, 2020

Closes #771


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

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you

lib/rubocop/rspec/language/node_pattern.rb Outdated Show resolved Hide resolved
@Darhazer
Copy link
Member

WDYT of adding block_or_block_pass_patern to the Language? cc: @bquorning

@pirj
Copy link
Member

pirj commented Apr 29, 2020

WDYT of adding block_or_block_pass_patern to the Language?

Makes sense, this might simplify lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb

@bquorning
Copy link
Collaborator

block_or_block_pass_patern

@Darhazer could you open a new issue for that? Or maybe a PR to showcase the change.

@Darhazer
Copy link
Member

Sure 👍

@tejasbubane
Copy link
Contributor Author

@bquorning @Darhazer I added block_or_block_pass_pattern here.

Copy link
Member

@Darhazer Darhazer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Affected cops:

1. `RSpec/ScatteredLet`
2. `RSpec/AlignLeftLetBrace`
3. `RSpec/AlignRightLetBrace`
4. `RSpec/LeadingSubject`
5. `RSpec/EmptyLineAfterFinalLet`
6. `RSpec/LetBeforeExamples`

Closes rubocop#771
@tejasbubane tejasbubane changed the title Fix RSpec/ScatteredLet to detect let with proc argument Fix multiple cops to detect let with proc argument Apr 29, 2020
@tejasbubane
Copy link
Contributor Author

@pirj Added specs for those other cops as well.

Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you open a new issue for that? Or maybe a PR to showcase the change.

I was clearly confused when I wrote that comment. Of course “the change” belongs in this PR. Thanks you for the bugfix and Language module improvements @tejasbubane 🚀

@bquorning bquorning mentioned this pull request Apr 29, 2020
9 tasks
@pirj pirj merged commit 52a7fe1 into rubocop:master Apr 29, 2020
@pirj
Copy link
Member

pirj commented Apr 29, 2020

Thank you!

@tejasbubane tejasbubane deleted the fix-771 branch April 29, 2020 13:05
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.

RSpec/ScatteredLet unexpected behavior on let(:x, &proc)
4 participants