Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect token type given to some resource attributes #232

Open
alexjfisher opened this issue Feb 7, 2025 · 0 comments
Open

Incorrect token type given to some resource attributes #232

alexjfisher opened this issue Feb 7, 2025 · 0 comments

Comments

@alexjfisher
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant