-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix for #3 & #3 (does not touch SniffTest.php) #5
base: master
Are you sure you want to change the base?
fix for #3 & #3 (does not touch SniffTest.php) #5
Conversation
…e" and how nesting level increment is calculated
minor note... the scrutinizer coding standard that is failing violates PSR-12 |
|
@Rarst
$nextToken = $this->phpcsFile->findNext(Tokens::$emptyTokens, $position + 1, null, true);
if ($nextToken === false || $tokens[$nextToken]['code'] !== T_SEMICOLON) { instead of simply looking at |
Ah, must have missed that. Checked branch as is now.
|
it was updated due to this message
Here's my phpunit 8 output
|
Gotcha, are you trying to run with PHPUnit 9? Scrutinizer is still set up against 8, so I am running with that locally as well. Can be updated at some point, but not related to the issue. |
Hm, which PHP CS version? Are you installing according to lock file or updating to latest? |
Yes.. I guess it's just 9 that throws that warning.... I just tested with PHPUnit 8.5.9 (see updated previous comment) and it's working |
re phpcs version
which is what's in composer.lock ¯\_(ツ)_/¯ |
Scrutinizer is currently failing on the constant thing too (tad different message, it's higher severity in PHP 8 locally). Not sure what's up with it, but PHP CS seems to expect it after the changes made. Probably could be just defined to false since we aren't doing anything CBF related? |
Updated tests/bootstrap.php
found snippet when googling "undefined PHP_CODESNIFFER_CBF" |
Ok, that exchanged for a new error in Scrutinizer:
Given that is a parameter being used for PHPUnit, PHP CS shouldn't even be looking at that. Think the changes to file parsing might be confusing PHP CS about running from a regular command line call, while that's not what is happening? Why were they necessary? (Ok, I see that was done to swap from tokens as result to the File object). |
I'm not sure what's going on with the coverage tests.... |
It looks to me like PHP CS code yanks arguments from command line and gets confused what those are (since command line is for PHPUnit actually). I am not familiar with its boot process to say why that happens or how could that be adjusted to not happen. |
… nesting increment
Ugh, busy year... War and stuff. :) So, I ditched Scrutinizer and moved tests setup to GitHub actions and more careful PHP 7.2 + PHPUnit 8 set up (for minimal supported requirements). For whatever reason now I have tests fail locally as well, the changes to file loading do seem to cause PHP CS to initialize badly and fall apart, one way or another. If you are still interested, could you please refresh this on top of current master (rebase the branch or merge master into it, should work too, I think)? That should get us tests running and reporting inline in PR here. |
refactor MaximumComplexity Sniff & Analyzer.php to utilize "$phpcsfile" and how nesting level increment is calculated
fixes #2 and #3 but SniffTest fails