Class: PuppetLintParamDocs::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/puppet-lint-param-docs/tasks.rb

Instance Method Summary collapse

Instance Method Details

#define_selectiveObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/puppet-lint-param-docs/tasks.rb', line 15

def define_selective
  PuppetLint::RakeTask.new(:lint_param_docs) do |config|
    config.fail_on_warnings = true
    config.disable_checks = (PuppetLint.configuration.checks - [:parameter_documentation])
    yield config
  end

  # Explicitly enable check as "lint" task will disable it
  task :lint_param_docs_enable do
    PuppetLint.configuration.enable_parameter_documentation
  end
  Rake::Task[:lint_param_docs].enhance [:lint_param_docs_enable]

  # Explicitly disable param doc in general lint task
  task :lint_param_docs_disable do
    PuppetLint.configuration.disable_parameter_documentation
  end
  Rake::Task[:lint].enhance [:lint_param_docs_disable]

  # Run param docs lint after main lint
  Rake::Task[:lint].enhance do
    Rake::Task[:lint_param_docs].invoke
  end
end