You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running rubocop on my codebase throws an error in the VariableForce cop.
An error occurred while VariableForce cop was inspecting /path/to/my/file.rb.
undefined method `method?' for "s(:pair,\n s(:sym, :json),\n s(:lvar, :foo))":RuboCop::AST::PairNode
Did you mean? method
methods
Steps to Reproduce
The following is the minimal code that caused the issue:
This definitely is partially caused by an interaction with the SaveBang cop. If I disable that cop, I get no error with the above code. Additionally if I remove the json: part of the render call I get no error. Or if I leave SaveBang enabled but change create to create! I get no error.
RuboCop version
0.48.1 (using Parser 2.4.0.0, running on ruby 2.4.0 x86_64-darwin16)
The text was updated successfully, but these errors were encountered:
…g assigned variable in a hash
This cop would raise an exception when the assigned variable was used as
a value in a hash, e.g.:
```
foo = Foo.create
render json: foo
```
This change fixes that.
Running rubocop on my codebase throws an error in the
VariableForce
cop.Steps to Reproduce
The following is the minimal code that caused the issue:
This definitely is partially caused by an interaction with the
SaveBang
cop. If I disable that cop, I get no error with the above code. Additionally if I remove thejson:
part of therender
call I get no error. Or if I leaveSaveBang
enabled but changecreate
tocreate!
I get no error.RuboCop version
The text was updated successfully, but these errors were encountered: