Sha256: 5cecf55a7d04e5bbbcc9bcc9baa00725f96e2784abfe70f183030d2c4756da35

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

PuppetLint.new_check(:resource_reference_without_title_capital) do
  def check
    resource_indexes.each do |resource|
      resource[:param_tokens].select { |param_token|
        ['require', 'subscribe', 'notify', 'before', 'consume', 'export'].include? param_token.value
      }.each do |param_token|
        value_token = param_token.next_code_token.next_code_token.next_code_token.next_token
        unless value_token.type == :SSTRING or value_token.type == :VARIABLE or value_token.type == :DQPRE or value_token.next_token.type == :SSTRING
          notify :error, {
            :message => 'resource reference with title with capital letter',
            :line    => value_token.line,
            :column  => value_token.column
          }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-lint-resource_reference_syntax-1.0.7 lib/puppet-lint/plugins/resource_reference_without_title_capital.rb
puppet-lint-resource_reference_syntax-1.0.6 lib/puppet-lint/plugins/resource_reference_without_title_capital.rb