Skip to content

Incorrect token type given to some resource attributes #232

Open
@alexjfisher

Description

@alexjfisher

If the name of a resource attribute clashes with a Puppet keyword, then puppet-lint does not assign it the :NAME token type, but a keyword token type instead.

For example, with this Exec resource

exec { '/bin/some_command':
  unless => '/bin/foo',
}

The unless bare word is assigned the :UNLESS token type. Since in this context, it is not the unless puppet keyword, it should be assigned the :NAME token type instead.

This also causes issues when using resource_indexes. The :param_tokens hash element for the above example is an empty array, when it should contain a single token (for the single attribute used).

From http://puppet-lint.com/developer/api/

:param_tokens - An Array of PuppetLint::Lexer::Token objects for the parameter names in the resource declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions