-
Notifications
You must be signed in to change notification settings - Fork 2
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
NEW Add sniffer code #1
NEW Add sniffer code #1
Conversation
src/Sniffer.php
Outdated
foreach ($todo as $block) { | ||
if ($block->ignored === false) { | ||
$currDir = dirname($block->realPath); | ||
if ($lastDir !== $currDir) { | ||
if (PHP_CODESNIFFER_VERBOSITY > 0) { | ||
echo 'Changing into directory ' . Common::stripBasepath($currDir, $sniffer->config->basepath) . PHP_EOL; | ||
} | ||
|
||
$lastDir = $currDir; | ||
} | ||
|
||
$sniffer->processFile($block); | ||
} else if (PHP_CODESNIFFER_VERBOSITY > 0) { | ||
echo 'Skipping ' . basename($block->path) . PHP_EOL; | ||
} | ||
|
||
$numProcessed++; | ||
$sniffer->printProgress($block, $numBlocks, $numProcessed); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this method, everything outside this loop is copied directly from Runner::run()
, so we probably don't want to change much of that.
61ab06c
to
58b240b
Compare
58b240b
to
cb5a657
Compare
For some reason this one doesn't get auto-fixed. | ||
|
||
- this one will be indented | ||
```php | ||
class FinalClass { | ||
private string $lastProperty='this is the value'; | ||
} | ||
``` | ||
- And it'll also have linting failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note about this one not getting auto-fixed is obviously pointing out a bug.
Once this PR is merged I'll raise a new issue about it, but I couldn't see an obvious way to resolve it. I figured it was better to have this working in the 90% of scenarios that it needs to for now, and we can fix that later on.
It does get correctly linted (there's another test validating that), so we will be able to fix those linting failures manually in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested, I've just done a fairly quick code scan over this
Was some of this code lifted and shifted from PHPCS? If so can you point out those bits so I can largely ignore them
As discussed in person, I've pointed the main blocks of these out with PR comments, plus the There are other bits here-and-there but not in such easily identifiable chunks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use standard namespaces
1e5c514
to
dc76ab9
Compare
NOTES
Issue