Defines classes to deal with issues, and message formatting and defines constants with Issues. @api public
TODO_HEREDOC
Assignment can only be made to certain types of left hand expressions such as variables.
When indexed assignment ($x[]=) is allowed, the leftmost expression must be a variable expression.
Appending to attributes is only allowed in certain types of resource expressions.
In case a model is constructed programmatically, it must create valid type references.
Issues when an expression is used where it is not legal. E.g. an arithmetic expression where a hostname is expected.
A hostname may only contain letters, digits, ‘_’, ‘-’, and ‘.’.
A hostname may only contain letters, digits, ‘_’, ‘-’, and ‘.’.
In certain versions of Puppet it may be allowed to assign to a not already assigned key in an array or a hash. This is an optional validation that may be turned on to prevent accidental mutation.
Assignment cannot be made to numeric match result variables
parameters cannot have numeric names, clashes with match result variables
Issues when an expression is used illegaly in a query. query only supports == and !=, and not <, > etc.
Variables are immutable, cannot reassign in the same assignment scope
Issues when a variable is not a NAME
This is allowed (3.1) and has not yet been deprecated. @todo configuration
Some expressions/statements may not produce a value (known as right-value, or rvalue). This may vary between puppet versions.
A class, definition, or node may only appear at top level or inside other classes @todo Is this really true for nodes? Can they be inside classes? Isn’t that too late? @api public
If an attempt is made to make a resource default virtual or exported.
For non applicable operators (e.g. << on Hash).
This is a runtime issue - storeconfigs must be on in order to collect exported. This issue should be set to :ignore when just checking syntax. @todo should be a :warning by default
This is a runtime issue - storeconfigs must be on in order to export a resource. This issue should be set to :ignore when just checking syntax. @todo should be a :warning by default
For unsupported operators (e.g. += and -= in puppet 4).
For operators that are not supported in specific contexts (e.g. ‘* =>’ in resource defaults)
When an attempt is made to use multiple keys (to produce a range in Ruby - e.g. $arr). This is not supported in 3x, but it allowed in 4x.
When a variable name contains a hyphen and these are illegal. It is possible to control if a hyphen is legal in a name or not using the setting TODO @todo describe the setting @api public @todo configuration if this is error or warning
Creates a non demotable issue. @see Issue.issue
# File lib/puppet/pops/issues.rb, line 126 def self.hard_issue(issue_code, *args, &block) result = Issue.new(issue_code, *args, &block) result.demotable = false result end
Defines an issue with the given `issue_code`, additional required parameters, and a block producing a message. The block is evaluated in the context of a MessageData which provides convenient access to all required arguments via accessor methods. In addition to accessors for specified arguments, these are also available:
`label` - a `LabelProvider` that provides human understandable names for model elements and production of article (a/an/the).
`semantic` - the model element for which the issue is reported
@param issue_code [Symbol] the issue code for the issue used as an identifier, should be the same as the constant
the issue is bound to.
@param args [Symbol] required arguments that must be passed when formatting the message, may be empty @param block [Proc] a block producing the message string, evaluated in a MessageData scope. The produced string
should not end with a period as additional information may be appended.
@see MessageData @api public
# File lib/puppet/pops/issues.rb, line 119 def self.issue (issue_code, *args, &block) Issue.new(issue_code, *args, &block) end