-
Notifications
You must be signed in to change notification settings - Fork 106
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
"pdk validate --auto-correct" removes the first two letters of the class module name when "pdk" encounters "include ::class_name" #1214
Comments
@bschonec Hey, having some issues with replicating this, could you confirm it is still an issue and if so, could you tell me what rule is enforcing this change. |
I neglected to include the '-a' argument for 'pdk validate'. I noticed that if I have only a "../manifests/a.pp" file with the above format that 'pdk validate -a' will remove the "pu" letters from the file. If I have another .pp file in the ../manifests directory, then the problem doesn't occur. Try your test again with only a single .pp file, please. |
@bschonec Could you tell me exactly what rule is being autocorrected to cause this? Given the file being corrected it seems likely that this is an issue with puppet-lint specifically. |
It seems to happen when: lookup('classes', Array[String], 'unique', []).include is included in the class module. I don't know if this helps: pdk (INFO): Using Ruby 3.2.2 |
The linter removes the first two characters after the double-colons only when this line precedes:
Once the double-colons are removed by the linter, then this behavior stops. |
Describe the bug
pdk-2.6.1.0-1.el7.x86_64
"pdk validate" incorrectly removes both the "::" and the first two letters of the class module to be included in the following instance:
The resulting file after correction:
Notice how "include ::puppet" has been changed to "include ::ppet". The bug happens after every occurrence of ".include":
BEFORE:
AFTER:
To Reproduce
The first "include ::class_module" following a line that contains ".include is incorrect. If you remove the ".include" after the lookup function, then no error occurs.
Expected behavior
Expectation is that the class module name is not altered (incorrectly) when removing the "::'.
Additional context
The text was updated successfully, but these errors were encountered: