We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Rails/SaveBang
Rails/SaveBang does not detect an implicit return when the method has multiple lines.
With the default configuration for Rails/SaveBang (AllowImplicitReturn: true) I expect the following to not generate an offense:
AllowImplicitReturn: true
def foo bar object.save end
The #save call is the last expression in the method and its return value will be returned by it.
#save
I get a Rails/SaveBang offense reported for object.save.
object.save
I made the tests for Rails/SaveBang use methods/blocks with multiple lines and they fail: maser@7e8839a
I noticed it in 2.26.2 and based the above commit on current master.
master
$ rubocop -V 1.66.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, running on ruby 3.3.4) [x86_64-linux] - rubocop-capybara 2.21.0 - rubocop-performance 1.22.1 - rubocop-rails 2.26.2 - rubocop-rspec 3.1.0 - rubocop-rspec_rails 2.30.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Rails/SaveBang
does not detect an implicit return when the method has multiple lines.Expected behavior
With the default configuration for
Rails/SaveBang
(AllowImplicitReturn: true
) I expect the following to not generate an offense:The
#save
call is the last expression in the method and its return value will be returned by it.Actual behavior
I get a
Rails/SaveBang
offense reported forobject.save
.Steps to reproduce the problem
I made the tests for
Rails/SaveBang
use methods/blocks with multiple lines and they fail: maser@7e8839aRuboCop version
I noticed it in 2.26.2 and based the above commit on current
master
.The text was updated successfully, but these errors were encountered: