Class: PuppetDocLint::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-doc-lint/result.rb

Instance Method Summary collapse

Instance Method Details

#percent_documentedObject



40
41
42
43
44
45
46
# File 'lib/puppet-doc-lint/result.rb', line 40

def percent_documented
  if documented_parameters.size == 0
    100
  else
    documented_parameters.size.percent_of(parameters.size).round(2)
  end
end

#result_reportObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/puppet-doc-lint/result.rb', line 21

def result_report
  puts "===================================="
  puts "Class #{class_name} ( #{file_name} )".bg_blue
  puts "Parameters found #{parameters}"
  if no_documentation
    puts "No documentation found.".red
    puts "Possible reasons:"
    puts "* The documentation is not formatted in the RDoc format"
    puts "* There's a bug in the puppet documentation parser"
    puts "* There is no documentation at all"
  else
    puts "Documented parameters found: #{documented_parameters}".green
    puts "Undocumented parameters found: #{undocumented_parameters}".red
    puts "Parameters with Documentation but no defintion: #{documented_parameter_no_assignment}".red unless documented_parameter_no_assignment.empty?
    puts "Documentation Coverage: #{percent_documented}%"
    puts "Authors: #{authors}" unless authors.empty?
  end
end