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
In the following sample, the return value of save is checked. Or, more exactly, it is not discarded. So there should be no warnings about it.
$ cat save.rb
res = true
res &&= foo.save
res &&= bar.save
res
Actual behavior
$ bundle exec rubocop save.rb
Inspecting 1 file
C
Offenses:
save.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
res = true
^
save.rb:2:13: C: [Correctable] Rails/SaveBang: Use save! instead of save if the return value is not checked.
res &&= foo.save
^^^^
save.rb:3:13: C: [Correctable] Rails/SaveBang: Use save! instead of save if the return value is not checked.
res &&= bar.save
^^^^
1 file inspected, 3 offenses detected, 3 offenses autocorrectable
Hi again!
Expected behavior
In the following sample, the return value of save is checked. Or, more exactly, it is not discarded. So there should be no warnings about it.
Actual behavior
Steps to reproduce the problem
See above.
RuboCop version
The text was updated successfully, but these errors were encountered: