Conversation
|
Test failures are legitimate. |
|
@nikic yes, because
If you agree with these changes, I'll update the tests |
In the past, single-line comments were stored together with the trailing newline. Later we switched to the PHP8 comment representation, where the trailing newline is not part of the comment anymore. As such, there is also no need to trim here. This is split out from GH-867.
|
The change to trimming is fine -- to verify, I've landed it separately as 1f504d2. This was a leftover from an older implementation, when comments were expected to have a trailing newline. It's some of the other changes that cause problematic changes in formatting. |
|
@nikic hm... I'm don't see how other changes can fail tests - content changed only here |
|
@nikic tests failed because |
|
@nikic I'm fixed fake/incorrect data passing to |
|
@nikic added alternative check to test instances: || ($this->endLine === -1 && strpos($this->text, "\n") !== false) |
getReformattedText(): fix@returntypes, remove comment trimming to keep empty lines in comment at begin and end, optimize detection of multi-line commentsgetShortestWhitespacePrefixLen(): replace floatINFtoPHP_INT_MAXjsonSerialize(): update@psalm-returnand remove redundant@return, fixnodeType