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
$ bundle exec rubocop x.rb --only Rails/SaveBang should be pass.
Actual behavior
./x.rb :
defxinstance.saveif@flagend
$ bundle exec rubocop x.rb --only Rails/SaveBang
Inspecting 1 file
C
Offenses:
x.rb:2:12: C: [Correctable] Rails/SaveBang: Use save! instead of save if the return value is not checked.
instance.save if @flag
^^^^
1 file inspected, 1 offense detected, 1 offense autocorrectable
note:
defx@flag && instance.saveend
is ok.
Steps to reproduce the problem
see above
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:
I agree that this alternative is a suitable and clean approach. It addresses the reported issue and aligns with best practices. If no one has objections, I believe we can consider this as a valid resolution.
Looking forward to any further discussions or feedback from the community!
Expected behavior
./x.rb :
$ bundle exec rubocop x.rb --only Rails/SaveBang
should be pass.Actual behavior
./x.rb :
note:
is ok.
Steps to reproduce the problem
see above
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:
The text was updated successfully, but these errors were encountered: