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
Lint/AmbiguousBlockAssociation with Rspec syntax #4222
Comments
I would probably recommend disabling this cop for specs, since it's a deliberate idiom in RSpec. 🙂
|
Exactly. |
koppen
added a commit
to substancelab/dotfiles
that referenced
this issue
May 26, 2017
Rubocop 0.48 introduced a new Lint/AmbiguousBlockAssocation cop [1], which guards against the issues detailed in rubocop/rubocop#3931. However, the pattern is a solid RSpec idiom and not likely to cause the problems Lint/AmbigiousBlockAssociation attempts to guard against. For example: expect { foo }.to change { bar } so we'll just ignore it in RSpec as suggested in rubocop/rubocop#4222. [1]: https://github.com/bbatsov/rubocop/blob/d1b9d66c3518389b0c408a6a4a42061b36748df4/relnotes/v0.48.0.md
dany1468
added a commit
to eightcard/pulis
that referenced
this issue
Jul 14, 2017
sebabeceiro
added a commit
to icariohealth/ruby-novu-code-style
that referenced
this issue
Jan 25, 2018
- This doesn't apply to rspec, see rubocop/rubocop#4222
instructure-gerrit
pushed a commit
to instructure/canvas-lms
that referenced
this issue
Feb 12, 2018
also fix a typo in .eslintignore caused by cae5d84 motivation: rubocop/rubocop#4222 (comment) this is a deliberate idiom in rspec, so let's update .robocop.yml to match rubocop's own config closes: GRADE-841 test plan: specs pass Change-Id: I534eabe48fb227b6fa7b425502e645f22b1a51f3 Reviewed-on: https://gerrit.instructure.com/140424 Tested-by: Jenkins Reviewed-by: Keith T. Garner <kgarner@instructure.com> Product-Review: Derek Bender <djbender@instructure.com> QA-Review: Derek Bender <djbender@instructure.com>
scmx
added a commit
to standout/Coding
that referenced
this issue
Mar 27, 2018
Lint/AmbiguousBlockAssociation: Parenthesize the param change { ... } to make sure that the block will be associated with the change method call. rubocop/rubocop#4222
bwebster
added a commit
to kapost/codeclimate-common
that referenced
this issue
Apr 30, 2018
- With our current config, we get a lot of linter errors from code that looks like this: expect { ... }.to change { MyModel.count } The linter error looks like this: Parenthesize the param `change { MyModel.count }` to make sure that the block will be associated with the `change` method call. This is rspec syntax and should not be flagged as a linter issue. - See rubocop/rubocop#4222
4 tasks
drn
added a commit
to drn/style-guide
that referenced
this issue
Jun 28, 2018
This exclusion is recommended (and used) by rubocop-hq. rubocop/rubocop#4222 (comment) https://github.com/rubocop-hq/rubocop/blob/master/.rubocop.yml#L63
drn
added a commit
to drn/style-guide
that referenced
this issue
Jun 28, 2018
This exclusion is recommended (and used) by rubocop-hq. rubocop/rubocop#4222 (comment) https://github.com/rubocop-hq/rubocop/blob/master/.rubocop.yml#L63
leeky
added a commit
to Crown-Commercial-Service/DataSubmissionServiceAPI
that referenced
this issue
Jul 26, 2018
If a supplier or agreement already exists, retrieve it rather than creating a brand new one. Added RuboCop exclusion for Lint/AmbiguousBlockAssociation, as per recommmendation: rubocop/rubocop#4222
leeky
added a commit
to Crown-Commercial-Service/DataSubmissionServiceAPI
that referenced
this issue
Jul 26, 2018
If a supplier or agreement already exists, retrieve it rather than creating a brand new one. Added RuboCop exclusion for Lint/AmbiguousBlockAssociation, as per recommmendation: rubocop/rubocop#4222
indocomsoft
added a commit
to nussucommit/takoyaki
that referenced
this issue
Nov 14, 2018
indocomsoft
added a commit
to nussucommit/takoyaki
that referenced
this issue
Nov 14, 2018
indocomsoft
added a commit
to nussucommit/takoyaki
that referenced
this issue
Nov 14, 2018
* Prevent unauthenticated users from signing up * Disable cop complaining about rspec idiom Refer to rubocop/rubocop#4222 * Fix style violation * Change authorization mc -> admin following UserController
emileswarts
added a commit
to alphagov/govwifi-user-signup-api
that referenced
this issue
Jan 2, 2019
This is the glue required to run the use cases. The Rubocop ignore syntax is due to this. rubocop/rubocop#4222
emileswarts
added a commit
to alphagov/govwifi-user-signup-api
that referenced
this issue
Jan 2, 2019
This is the glue required to run the use cases. The Rubocop ignore syntax is due to this. rubocop/rubocop#4222
emileswarts
added a commit
to alphagov/govwifi-user-signup-api
that referenced
this issue
Jan 2, 2019
This is the glue required to run the use cases. The Rubocop ignore syntax is due to this. rubocop/rubocop#4222
emileswarts
added a commit
to alphagov/govwifi-user-signup-api
that referenced
this issue
Jan 2, 2019
* Add obfusticate user details functionality This used to be done by a lambda written in Python. We've since decided that all cron tasks will be run as ECS scheduled tasks. This still needs to be invoked through a rake task. * Create Rake tasks for deleting user details This is the glue required to run the use cases. The Rubocop ignore syntax is due to this. rubocop/rubocop#4222
6 tasks
VegaFromLyra
added a commit
to VegaFromLyra/dev.to
that referenced
this issue
Jan 26, 2020
* Sidekiq version of delayed job and updating services that used the delayed job * Intentionally removed the defensive check in the sidekiq version. If the episode is missing and there's worker scheduled to update it's media url then that reveals a bug elsewhere and should fail fast instead of skipping ahead. * Also excluded the ambiguous block rule for rspecs since that conflicts with the rspec `expect` block, found that recommentation thanks to rubocop/rubocop#4222 (and rubocop was complaining about this in the pre-commit hook for these changes)
8 tasks
11 tasks
Mifrill
added a commit
to Mifrill/thread_safe_uniqueness_record
that referenced
this issue
Oct 30, 2020
skelz0r
added a commit
to etalab/admin_api_entreprise
that referenced
this issue
Aug 25, 2022
skelz0r
added a commit
to etalab/admin_api_entreprise
that referenced
this issue
Aug 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm quite lost with this example:
The offence is:
I tried few other ways, but either Rubocop is not happy or it's not a valid Ruby syntax.
The text was updated successfully, but these errors were encountered: