-
Notifications
You must be signed in to change notification settings - Fork 208
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
puppet-lint reports incorrect line numbers #403
Comments
This also breaks on multi-line comments (of the form /* comment */) I know this is frowned upon in the formatting guidelines, but it's still legal syntax and is used widely enough that it'd be nice to have the lint checks work correctly. |
@utoddl @cmckendry Can you provide a link to example code that suffers from this issue, please? Thank you! |
Here's a complete example. Create foo.pp with the following content:
Then run "puppet-lint foo.pp" to get the following output:
It should say, " ...on line 5". The line counter isn't being incremented in multi-line strings (or comments according to @cmckendry ) |
I missed this and reported #565 (a duplicate). A fix for this problem is already in the master branch, but only handles single quoted strings. My pull request #577 handles double quoted strings the same way, however, I see in this issue that this also happens for multi line comments and that is not fixed. |
@utoddl I tested with your sample code and it looks okay so I am closing this. Please re-open if you find a related fault. Thanks!
|
puppet-lint reports incorrect line numbers for issues it finds if there are multi-line string constants preceding the issue. For example, if the .pp file being examined has a 6 line string starting on line 100 and a 46 line string starting on line 150, then a problem with line 250 is reported as being on line 200. Also, the --with-context option will show the text of line 200 rather than the text of line 250 where the actual error is.
In short, multi-line strings throw puppet-lint's error reporting off.That is, line counting gets thrown off by N-1 for each N-line string.
Our "puppet-lint --version" returns "puppet-lint 1.1.0" if that helps.
The text was updated successfully, but these errors were encountered: