You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got a dependabot PR today that updates slevomat/coding-standard from 8.13.4 to 8.14.1, and I'm getting two new failures on the same code and configuration that was passing before. They both claim to be fixable, but running phpcbf yields "FAILED TO FIX". Here are the details:
Error Output
$ phpcs -s
FILE: php-tuf/composer-stager/src/API/Precondition/Service/PreconditionInterface.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
41 | ERROR | [x] Expected 1 line between description and annotations, found 0.
| | (SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectLinesCountBetweenDescriptionAndAnnotations)
44 | ERROR | [x] Expected 0 lines after last content, found 1. (SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectLinesCountAfterLastContent)
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------
/** * Gets a short status message. * * This reflects the actual status of the precondition at runtime and may * include details for resolving an unfulfilled precondition, e.g., "The * example dependency is ready," or if unfulfilled, "The example dependency * cannot be found. Make sure it's installed." If the precondition has * unfulfilled leaves, the status message from the first one will be returned. * * @param int $timeout * An optional process timeout (maximum runtime) in seconds. If set to * zero (0), no time limit is imposed. */publicfunction getStatusMessage(
PathInterface$activeDir,
PathInterface$stagingDir,
?PathListInterface$exclusions = null,
int$timeout = ProcessInterface::DEFAULT_TIMEOUT,
): TranslatableInterface;
The problems seems to have something to do with the quotation marks (") in the docblock. The simplest test case I've been able to construct to reproduce the problem involves four or more of them on different lines and at least one @param tag (below). It doesn't seem to matter whether there are line breaks or other characters in the text as long as there are at least four quotation marks on at least four lines. As I add @param tags the errors multiply.
Update: After some more investigation, it looks like the root cause is actually in phpstan/phpdoc-parser. On its v1.23.0 my scans pass. On v1.23.1 they fail as detailed above.
What's the proper way to proceed given the fact that the problem isn't with slevomat/coding-standard itself? Move this issue to phpstan/phpdoc-parser? Create a new one there?
I got a dependabot PR today that updates
slevomat/coding-standard
from 8.13.4 to 8.14.1, and I'm getting two new failures on the same code and configuration that was passing before. They both claim to be fixable, but runningphpcbf
yields "FAILED TO FIX". Here are the details:Error Output
Code in Question
https://github.com/php-tuf/composer-stager/blob/d74d77059d5b4d6abe3558703a80f534162491d2/src/API/Precondition/Service/PreconditionInterface.php#L34-L52
Configuration
https://github.com/php-tuf/composer-stager/blob/d74d77059d5b4d6abe3558703a80f534162491d2/phpcs.xml.dist#L101C50-L120
Observations
The problems seems to have something to do with the quotation marks (
"
) in the docblock. The simplest test case I've been able to construct to reproduce the problem involves four or more of them on different lines and at least one@param
tag (below). It doesn't seem to matter whether there are line breaks or other characters in the text as long as there are at least four quotation marks on at least four lines. As I add@param
tags the errors multiply.If it's helpful for testing/debugging, you can checkout the affected branch of my repo at https://github.com/php-tuf/composer-stager/tree/develop:
The text was updated successfully, but these errors were encountered: