-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Sniffs that check EOF newlines don't detect newlines properly when the last token is a doc block #1141
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
Comments
This is because the last token is a doc comment, and is tokenized as |
Note that your second file doesn't produce any errors. |
…s properly when the last token is a doc block
…ould sometimes be (boolean) false (was causing failures for #1141)
I should note that the first file is a snippet from a larger file that would error out. https://raw.githubusercontent.com/Kunena/Kunena-Forum/K5.1/src/libraries/kunena/bbcode/bbcode.php As for the second file, it was erroring on 2.6.0 so maybe it's no longer an issue in 2.7.0. |
Just confirming this is fixed now. Had a few unit test problems given the comment was not closed. Especially with HHVM, which just removed that entire comment from the file content while parsing. |
Forgot to say: thanks for the bug report :) |
You are welcome, Thank you. |
Uh oh!
There was an error while loading. Please reload this page.
I have run into occasions where Generic.Files.EndFileNewline or PSR2.Files.EndFileNewline will throw an error on a file that does end with a new line.
Fixing the files with phpcbf will add another new line and will still error when checked again. this is what a post fixer error looks like
Example files that have such an issue are included (one PHP, one CSS).
GitHub.zip
Expected behavior
If there is an empty new line at the end of the file there should be no PSR2.Files.EndFileNewline.NoneFound or Generic.Files.EndFileNewline.NoneFound error
Expected 1 newline at end of file; 0 found
regardless of the code that is before that last newline in the file.The text was updated successfully, but these errors were encountered: