-
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
Tokenizer: support hash comment for ignore annotations #3071
Tokenizer: support hash comment for ignore annotations #3071
Conversation
Let's put this PR on hold for now until support for PHP 8.0 attributes has been investigated as it may complicate that. |
Sorry, I never came back to this after attribute support was added. |
Shall I rebase and add some tests to make sure they pass ? |
@gsherwood I'm also tempted to refactor that test file to use data providers to see more easily which cases are being tested. Would you be okay with that ? If so, I'll do it after we got this PR out of the way. |
Until now, for the PHPCS native ignore annotations, only `//` slash or `/* */` star-style comments were supported. This adds support for PHPCS native ignore annotations using `#` hash-style comments. Includes unit tests and syncing of the `ltrim()` used in `File::process()` with the `ltrim()` used in `Tokenizer::createPositionMap()`.
855ed03
to
807c10c
Compare
PR updated, now including allowance for "late suppression" with All seems to work fine. |
Sounds like a good idea. |
Thanks a lot for finishing this off. Merged now. |
Tokenizer: support hash comment for ignore annotations
Until now, for the PHPCS native ignore annotations, only
//
slash or/* */
star-style comments were supported.This adds support for PHPCS native ignore annotations using
#
hash-style comments.Includes unit tests and syncing of the
ltrim()
used inFile::process()
with theltrim()
used inTokenizer::createPositionMap()
.