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
Allow phpcbf to use the cache #485
Comments
Thanks for opening this issue @fredden. You already know my opinion: this is more complicated than you initially thought. If I look at the table above, I still see logic logic errors. If the caching feature is active, the cache at the end of a run should always be complete and correct, so in my opinion, your entries in the "Only fixable errors" and "Fixable and unfixable errors" rows for In the mean time, let's close #481. |
Wouldn't it be possible to start small? Just skip the files that are already cached and with no errors if unmodified since last phpcs run. |
In my call with @jrfnl, we determined that there are not actually any logic errors, but instead the language used was confusing. I will review the words/language to better communicate the intent. |
Just came across old repo issue squizlabs/PHP_CodeSniffer#3781 and I think that needs to be looked into in relation to this ticket as it gives the impression that - at least in some cases - the cache is already being taken into account for PHPCBF.... |
Is your feature request related to a problem?
Yes and no. When using
phpcs --cache
, subsequent runs are fast. When usingphpcbf --cache
, every run takes the same amount of time as the first.Describe the solution you'd like
When using
phpcbf --cache
, subsequent runs should be faster - as they already are withphpcs --cache
. Also, when using bothphpcs
andphpcbf
, the cache generated by one should be usable by the other.The following table shows the behaviour that I expect. Here "empty cache" means that the file being scanned either has no entry in the cache, or its entry is somehow invalid (eg, the file content has changed).
phpcs
(cache miss)phpcbf
(cache miss)phpcs
(cache hit)phpcbf
(cache hit)Additional context (optional)
Given the low test coverage of the areas in question here, making changes to this functionality is risky. Therefore this feature is likely blocked by #146 and/or #147
Some initial work can be seen here: #481
The text was updated successfully, but these errors were encountered: