PuppetLint.new_check(:yumrepo_gpgcheck_enabled) do
  def check
    resource_indexes.each do |resource|
      next unless resource[:type].value == 'yumrepo'

      # if the gpgcheck value doesn't exist then warn and return early.
      if resource[:param_tokens].select { |pt| pt.value == 'gpgcheck' }.empty?

        notify :warning, {
          message: 'yumrepo should have the gpgcheck attribute',
          line:    resource[:type].line,
          column:  resource[:type].column,
        }

      else # we have at least one gpgcheck - check it's enabled

        resource[:param_tokens].select { |param_token|
          param_token.value == 'gpgcheck'
        }.each do |content_token|
          setting = content_token.next_code_token.next_code_token

          # skip if valid. we only care about broken settings.
          next if ['True', 1, '1', 'Yes'].include? setting.value

          notify :warning, {
            message: 'yumrepo should enable the gpgcheck attribute',
            line:    setting.line,
            column:  setting.column,
          }

        end
      end
    end
  end
end

PuppetLint.new_check(:yumrepo_gpgcheck_enabled) do
  def check
    resource_indexes.each do |resource|
      next unless resource[:type].value == 'yumrepo'

      # if the gpgcheck value doesn't exist then warn and return early.
      if resource[:param_tokens].select { |pt| pt.value == 'gpgcheck' }.empty?

        notify :warning, {
          message: 'yumrepo should have the gpgcheck attribute',
          line:    resource[:type].line,
          column:  resource[:type].column,
        }

      else # we have at least one gpgcheck - check it's enabled

        resource[:param_tokens].select { |param_token|
          param_token.value == 'gpgcheck'
        }.each do |content_token|
          setting = content_token.next_code_token.next_code_token

          # skip if valid. we only care about broken settings.
          next if ['true', 1, '1', 'yes'].include? setting.value

          notify :warning, {
            message: 'yumrepo should enable the gpgcheck attribute',
            line:    setting.line,
            column:  setting.column,
          }

        end
      end
    end
  end
end

Allow true and yes to match the correct settings
Allow true and yes to match the correct settings

https://puppet.com/docs/puppet/5.5/types/yumrepo.html#yumrepo-attribute-gpgcheck states:

gpgcheck

(Property: This attribute represents concrete state on the target system.)

Whether to check the GPG signature on packages installed from this repository. Valid values are: false/0/no or true/1/yes. Set this to absent to remove it from the file completely.

Valid values are absent. Values can match /^(true|false|0|1|no|yes)$/.
