Class PuppetLint::Checks
In: lib/puppet-lint/plugin.rb
Parent: Object

Methods

Attributes

manifest_lines  [R] 
problems  [R] 

Public Class methods

Public Instance methods

Internal: Calculate the positions of all class definitions within the tokenised manifest.

Returns an Array of Hashes, each containing:

  :start - An Integer position in the `tokens` Array pointing to the first
           token of a class (type :CLASS).
  :end   - An Integer position in the `tokens` Array pointing to the last
           token of a class (type :RBRACE).

Internal: Calculate the positions of all defined type definitions within the tokenised manifest.

Returns an Array of Hashes, each containing:

  :start - An Integer position in the `tokens` Array pointing to the first
           token of a defined type (type :DEFINE).
  :end   - An Integer position in the `tokens` Array pointing to the last
           token of a defined type (type :RBRACE).
    notify(kind, message_hash)    #=> nil

Adds the message to the problems array. The kind gets added to the message_hash by setting the key :kind. Typically, the message_hash should contain following keys:

message:which contains a string value describing the problem
linenumber:which contains the line number on which the problem occurs.

Besides the :kind value that is being set, some other key/values are also added. Typically, this is

check:which contains the name of the check that is being executed.
linenumber:which defaults to 0 if the message does not already contain one.
    notify :warning, :message => "Something happened", :linenumber => 4
    => {:kind=>:warning, :message=>"Something happened", :linenumber=>4, :check=>'unknown'}

Internal: Calculate the positions of all resource declarations within the tokenised manifest. These positions only point to the content of the resource declaration, they do not include resource types or titles/namevars.

Returns an Array of Hashes, each containing:

  :start - An Integer position in the `tokens` Array pointing to the first
           Token of a resource declaration parameters (type :NAME).
  :end   - An Integer position in the `tokens` Array pointing to the last
           Token of a resource declaration parameters (type :RBRACE).

[Validate]