skip offenses for heredoc scripts and calls with custom env

needed for e.g. àwscli`, `hatch`, `pipenv`
This commit is contained in:
Max Eisner 2022-08-11 17:45:38 +02:00
parent 02c9cc0720
commit 3fec64f386
No known key found for this signature in database
GPG Key ID: 4BF122C22879F0C8

View File

@ -462,6 +462,9 @@ module RuboCop
end
shell_completion_node(install) do |node|
next if node.source.include?("<<~") # skip heredoc completion scripts
next if node.source.match?(/{.*=>.*}/) # skip commands needing custom ENV variables
offending_node(node)
problem "Use `generate_completions_from_executable` DSL instead of `#{@offensive_node.source}`."
end