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
[7, 16] in /home/user_name/github/foo_app/app/controllers/file_uploads_controller.rb
7:
8: private
9:
10: def use_rack_response((status, headers, body))
11: self.status = status
12: headers.merge! headers
13: self.response_body = body
14: byebug
=> 15: end
16: end
(byebug) headers
{"Content-Type"=>"application/json; charset=utf-8", "Cache-Control"=>"no-store", "Content-Length"=>"753"}
(byebug) self.headers
{"X-Frame-Options"=>"SAMEORIGIN", "X-XSS-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff", "X-Download-Options"=>"noopen", "X-Permitted-Cross-Domain-Policies"=>"none", "Referrer-Policy"=>"strict-origin-when-cross-origin"}
(byebug)
Expected behavior
RuboCop auto correction should not change the semantics of the code sample.
Actual behavior
RuboCop auto correction changes the semantics of the code sample.
Steps to reproduce the problem
~/tmp$ bundle ex rubocop -V
1.11.0 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 3.0.0 x86_64-linux)
~/tmp$ cat sample.rb
# frozen_string_literal: true
def sample_method((a, b))
self.a = a
self.b.some_method_call b
end
~/tmp$ bundle ex rubocop -a sample.rb
Inspecting 1 file
C
Offenses:
sample.rb:5:3: C: [Corrected] Style/RedundantSelf: Redundant self detected.
self.b.some_method_call b
^^^^^^
1 file inspected, 1 offense detected, 1 offense corrected
Tip: Based on detected gems, the following RuboCop extension libraries might be helpful:
* rubocop-rspec (http://github.com/rubocop/rubocop-rspec)
You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options):
AllCops:
SuggestExtensions: false
~/tmp$
RuboCop version
~/tmp$ bundle ex rubocop -V
1.11.0 (using Parser 3.0.0.0, rubocop-ast 1.4.1, running on ruby 3.0.0 x86_64-linux)
The text was updated successfully, but these errors were encountered:
Hi.
I encounted similer case of #5581.
I'm workaround it with a disable comment now.
Thank you.
Minimum example
before
after
Concrete example
I read an example of Shrine gem documentation and tried this.
Expected behavior
RuboCop auto correction should not change the semantics of the code sample.
Actual behavior
RuboCop auto correction changes the semantics of the code sample.
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: