Class: RuboCop::Cop::InSpecStyle::AzureGenericResource

Inherits:
RuboCop::Cop
  • Object
show all
Defined in:
lib/rubocop/cop/inspecstyle/azure_generic_resource.rb

Overview

Do not use azure_generic_resource

Examples:

EnforcedStyle: InSpecStyle (default)

# azure_generic_resource has been deprecated
# 'https://github.com/inspec/inspec/issues/3131'
# Since there are multiples replacements autocorrect is not supported.

# bad
azure_generic_resource

# good
azurerm_virtual_machine # use a specific resource pack resource

Constant Summary collapse

MSG =
'Use a specific resource instead of `#azure_generic_resource`. '\
'This resource will be removed in InSpec 5.'

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



27
28
29
30
31
# File 'lib/rubocop/cop/inspecstyle/azure_generic_resource.rb', line 27

def on_send(node)
  return unless azure_generic_resource?(node)

  add_offense(node, location: :selector)
end