rodjek / puppet-lint

Check that your Puppet manifests conform to the style guide
MIT License
819 stars 204 forks source link

Do not rely on tokens array positioning when fixing ensure_first_param problems #914

Closed rodjek closed 4 years ago

rodjek commented 4 years ago

Currently the fix method for this check relies upon the position of the first parameter in the tokens array to operate which is determined when the manifest is first loaded. If checks with fix methods that add or remove tokens (like the trailing_whitespace check) run before this check, the saved position becomes no longer accurate causing the fix method to fail.

Fixes #906 Fixes #905 Fixes #839