use #inspect instead of wrapping symbols

This commit is contained in:
Max Eisner 2022-07-31 21:16:41 +02:00
parent a002463362
commit de7ef64f61
No known key found for this signature in database
GPG Key ID: 4BF122C22879F0C8

View File

@ -435,9 +435,9 @@ module RuboCop
shell_parameter_format = if shell_parameter_stripped.empty?
nil
elsif shell_parameter_stripped == "--"
":flag"
:flag
elsif shell_parameter_stripped == "--shell="
":arg"
:arg
else
"\"#{shell_parameter_stripped}\""
end
@ -449,7 +449,7 @@ module RuboCop
replacement_args << "executable: #{executable}"
end
replacement_args << "cmd: \"#{cmd}\"" unless cmd == "completion"
replacement_args << "shell_parameter_format: #{shell_parameter_format}" unless shell_parameter_format.nil?
replacement_args << "shell_parameter_format: #{shell_parameter_format.inspect}" unless shell_parameter_format.nil?
offending_node(node)
replacement = "generate_completions_from_executable(#{replacement_args.join(", ")})"