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
I have enabled Style/MethodCallWithArgsParentheses cop in my .rubocop.yml:
Style/MethodCallWithArgsParentheses
Style/MethodCallWithArgsParentheses: Enabled: true
And my file:
puts "boom".colorize(:red) puts 2
When I run it with auto-correct it generates invalid ruby code Could be related to #5951 or #5983
Auto-corrected file should be:
puts("boom".colorize(:red)) puts(2)
Auto-corrected file is invalid:
puts(boom".colorize(:red) puts(2)
$ rubocop --debug --auto-correct rubocop_example.rb --only Style/MethodCallWithArgsParentheses For /Volumes/Second/work/bma-calabash: configuration from /Volumes/Second/work/bma-calabash/.rubocop.yml Inheriting configuration from /Volumes/Second/work/bma-calabash/.rubocop_todo.yml Default configuration from /Users/bayandin/.rvm/gems/ruby-2.5.1/gems/rubocop-0.57.2/config/default.yml Inheriting configuration from /Users/bayandin/.rvm/gems/ruby-2.5.1/gems/rubocop-0.57.2/config/enabled.yml Inheriting configuration from /Users/bayandin/.rvm/gems/ruby-2.5.1/gems/rubocop-0.57.2/config/disabled.yml Inspecting 1 file Scanning /Volumes/Second/work/bma-calabash/rubocop_example.rb F Offenses: rubocop_example.rb:1:1: C: [Corrected] Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments. puts "boom".colorize(:red) ^^^^^^^^^^^^^^^^^^^^^^^^^^ rubocop_example.rb:1:10: F: Lint/Syntax: unterminated string meets end of file (Using Ruby 2.5 parser; configure using TargetRubyVersion parameter, under AllCops) puts(boom".colorize(:red) ^ rubocop_example.rb:2:1: C: [Corrected] Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments. puts 2 ^^^^^^ 1 file inspected, 3 offenses detected, 2 offenses corrected Finished in 0.41572399996221066 seconds
$ cat rubocop_example.rb puts(boom".colorize(:red) puts(2)
$ rubocop -V 0.57.2 (using Parser 2.5.1.0, running on ruby 2.5.1 x86_64-darwin17)
The text was updated successfully, but these errors were encountered:
[Fix #6071] Fix MethodCallWithArgsParentheses when args are method ca…
d1651be
…lls (#6083)
Successfully merging a pull request may close this issue.
I have enabled
Style/MethodCallWithArgsParentheses
cop in my .rubocop.yml:And my file:
When I run it with auto-correct it generates invalid ruby code
Could be related to #5951 or #5983
Expected behavior
Auto-corrected file should be:
Actual behavior
Auto-corrected file is invalid:
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: