You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
demo@demo-u20-lts:~/puppet/demo_array_of_hashes$ more manifests/init.pp
class demo_array_of_hashes () {
$users = lookup('demo_array_of_hashes::users')
notice(inline_template("
<% @users.each do |user| -%>
id=<%= user['id'] %>
quota=<%= user['quota'] %>
<% end -%>
"))
}
demo@demo-u20-lts:~/puppet/demo_array_of_hashes$ pdk validate --auto-correct
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.22.0
pdk (INFO): Running all available validators...
pdk (INFO): Validator 'puppet-epp' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["/*.epp"]' found to validate.
pdk (INFO): Validator 'task-name' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["tasks//"]' found to validate.
pdk (INFO): Validator 'task-metadata-lint' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["tasks/.json"]' found to validate.
┌ [✔] Running metadata validators ...
├── [✔] Checking metadata syntax (metadata.json tasks/.json).
└── [✔] Checking module metadata style (metadata.json).
┌ [✖] Running puppet validators ...
├── [✔] Checking Puppet manifest syntax (**/.pp).
└── [✖] Checking Puppet manifest style (**/*.pp).
[
Whoops! It looks like puppet-lint has encountered an error that it doesn't
know how to handle. Please open an issue at https://github.com/rodjek/puppet-lint
and paste the following output into the issue description.
Describe the Bug
Trying to run " pdk validate --auto-correct --parallel" on the attached code will cause an error.
Expected Behavior
Should succeed and output corrected code with indent
Steps to Reproduce
Create the class (files needed attached at the end)
pdk validate --auto-correct
Environment
demo@demo-u20-lts:~/$ dpkg --list | egrep pdk
ii pdk 2.6.1.0-1focal amd64 Puppet Development Kit
Additional Context
demo@demo-u20-lts:~/puppet/demo_array_of_hashes$ cat data/common.yaml
demo_array_of_hashes::users:
quota: '10'
quota: '20'
demo@demo-u20-lts:~/puppet/demo_array_of_hashes$ more manifests/init.pp
class demo_array_of_hashes () {
$users = lookup('demo_array_of_hashes::users')
notice(inline_template("
<% @users.each do |user| -%>
id=<%= user['id'] %>
quota=<%= user['quota'] %>
<% end -%>
"))
}
demo@demo-u20-lts:~/puppet/demo_array_of_hashes$ pdk validate --auto-correct
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.22.0
pdk (INFO): Running all available validators...
pdk (INFO): Validator 'puppet-epp' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["/*.epp"]' found to validate.
pdk (INFO): Validator 'task-name' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["tasks//"]' found to validate.
pdk (INFO): Validator 'task-metadata-lint' skipped for '/home/demo/puppet/demo_array_of_hashes'. No files matching '["tasks/.json"]' found to validate.
┌ [✔] Running metadata validators ...
├── [✔] Checking metadata syntax (metadata.json tasks/.json).
└── [✔] Checking module metadata style (metadata.json).
┌ [✖] Running puppet validators ...
├── [✔] Checking Puppet manifest syntax (**/.pp).
└── [✖] Checking Puppet manifest style (**/*.pp).
[
Whoops! It looks like puppet-lint has encountered an error that it doesn't
know how to handle. Please open an issue at https://github.com/rodjek/puppet-lint
and paste the following output into the issue description.
puppet-lint version: 2.5.2
ruby version: 2.7.7-p221
platform: x86_64-linux
file path: manifests/init.pp
file contents:
error:
┌ [✔] Running ruby validators ...
└── [✔] Checking Ruby code style (/.rb).
┌ [✔] Running tasks validators ...
├── [✔] Checking task names (tasks//).
└── [✔] Checking task metadata style (tasks/.json).
┌ [✔] Running yaml validators ...
└── [✔] Checking YAML syntax (/.yaml **/.yml).
The text was updated successfully, but these errors were encountered: