84codes / rubocop-eighty-four-codes

Cops!
https://rubygems.org/gems/rubocop-eightyfourcodes
MIT License
0 stars 2 forks source link

Improve `CommandLiteralInjection` #9

Open dentarg opened 1 month ago

dentarg commented 1 month ago

The suggestion from CommandLiteralInjection isn't great, just switching from the backtick method to system does not make what ever you are doing safe. https://ruby-doc.org/3.3.0/command_injection_rdoc.html

https://github.com/84codes/rubocop-eighty-four-codes/blob/c5a1f07d20af5c147568f21bc5c260f96791f8e1/lib/rubocop/cop/eighty_four_codes/command_literal_injection.rb#L3-L19

dentarg commented 1 month ago

Also, backtick method, system and exec all have pretty different behaviour.