Difference in puppet-lint behavior between `pdk validate` and `rake lint` - Ruby pdk

pdk validate runs puppet-lint without any custom configuration, whereas the rake lint task as referenced in the default CI configs (https://github.com/puppetlabs/pdk-templates/blob/c43fc26e5607a038137ba3d7a9cb944eb171330b/configdefaults.yml#L78 and https://github.com/puppetlabs/pdk-templates/blob/c43fc26e5607a038137ba3d7a9cb944eb171330b/configdefaults.yml#L99, for example) disable several checks and exclude several files, as defined in puppetlabs_spec_helper: https://github.com/puppetlabs/puppetlabsspechelper/blob/07978467ed536ce1fcc8b2d0dbb830800e06c9b9/lib/puppetlabsspechelper/rake_tasks.rb#L172-L192

PuppetLint::RakeTask.new(:lint) do |config|
  config.fail_on_warnings = true
  config.disable_checks = %w[
    80chars
    140chars
    class_inherits_from_params_class
    class_parameter_defaults
    disable_autoloader_layout
    documentation
    single_quote_string_with_variables
  ]
  config.ignore_paths = [
    '.vendor/**/*.pp',
    'bundle/**/*.pp',
    'pkg/**/*.pp',
    'spec/**/*.pp',
    'tests/**/*.pp',
    'types/**/*.pp',
    'vendor/**/*.pp',
  ]
end

I think it would be preferable for the default configuration to match between the two projects maintained by Puppet.

Asked Oct 05 '21 03:10
avatar nabertrand
nabertrand

3 Answer:

Hi @nabertrand,

Yes we have several related issues here that we need to address to make things more consistent. I will update this issue when we have a JIRA issue you can track or when we have resolved things.

1
Answered Jun 04 '19 at 00:10
avatar  of scotje
scotje

This is loosely related to #372 and PDK-709 - we should certainly consider rolling this in to a discussion that encompasses all of that work.

1
Answered Apr 12 '21 at 14:16
avatar  of sanfrancrisko
sanfrancrisko

I'm closing this ticket and hoping we can continue the conversation on #1069

1
Answered Apr 16 '21 at 11:22
avatar  of sanfrancrisko
sanfrancrisko