-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PSR12.Files.FileHeader false positive when file only contains docblock #2616
Comments
I think Datadog/dd-trace-php is hitting this same issue for a different reason in branch levi/phpcs: circleci@82b8c67c4988:~/app$ composer lint
> phpcs -s --ignore=src/DDTrace/Integrations/ZendFramework/V1/Ddtrace.php
FILE: /home/circleci/app/tests/Unit/Util/TryCatchFinallyTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
226 | ERROR | [x] Header blocks must be followed by a single blank
| | line
| | (PSR12.Files.FileHeader.SpacingAfterBlock)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 39.58 secs; Memory: 20.25MB
Script phpcs -s --ignore=src/DDTrace/Integrations/ZendFramework/V1/Ddtrace.php handling the lint event returned with error code 2
circleci@82b8c67c4988:~/app$ composer fix-lint
> phpcbf
PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE FIXED REMAINING
----------------------------------------------------------------------
...cleci/app/tests/Unit/Util/TryCatchFinallyTest.php FAILED TO FIX
----------------------------------------------------------------------
A TOTAL OF 0 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------
PHPCBF FAILED TO FIX 1 FILE
----------------------------------------------------------------------
Time: 37.31 secs; Memory: 20.25MB
Script phpcbf handling the fix-lint event returned with error code 2 I've since disabled the lint, so be sure to use the link as it points to a specific commit. |
…st.php This lint may have a bug: squizlabs/PHP_CodeSniffer#2616
…st.php This lint may have a bug: squizlabs/PHP_CodeSniffer#2616
…st.php This lint may have a bug: squizlabs/PHP_CodeSniffer#2616
Thanks for the report. I've committed a fix, which will be in 3.5.1. |
It''s bugging out all of my repos... We've been doing |
Hi, Is there an explanation on why it's impossible to do the following? <?php
declare(strict_types=1); The blank line is a waste of space imo. |
The already added newline is a big waste of space :) |
Those sort of questions are better directed to the authors of PSR-12. I had nothing to do with the writing of the standard so I can't talk to the decisions within it. I've just implemented it in PHPCS as faithfully as I can. |
is unfixable.
It doesn't respect a file that only contains a docblock.
code is:
The text was updated successfully, but these errors were encountered: