-
-
Notifications
You must be signed in to change notification settings - Fork 73
Colors in cacheFileReport cannot be switched off #1050
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
Conversation
@amenk Thank you for your PR and your willingness to contribute to PHPCS. Currently CI does not pass on this PR, this needs to be fixed before someone will look at the PR. |
I am using ``` vendor/bin/phpcs --report="diff" --extensions="php" --no-colors --report-diff=var/phpcs_report_680bb28374ffe.diff ``` to see some progress. In this case, it was not possible to switch of colors in the diff file.
@jrfnl thanks, updated |
@amenk Thanks for the PR. I've been trying to reproduce the issue, but am failing. I've also tried to see if this fixes #787, which I can reproduce, but no such luck either. Please add more detailed reproduction steps to the PR as I currently cannot validate the supposed bug, nor the fix. The way I've tried to reproduce this: Test file <?PHP
echo 'hello' ;
$var = 10+1; Tests tried:
I've also tried with having both the Next, I tried to reproduce this with the JSON report, so Tested against |
@jrfnl thanks for the elaborate tests. In the meanwhile I fixed all the violations in my codebase where this appeared. Anyways, my main motivation to get a color-less diff was, to be able to apply it via So this MR is kind of obsolete, but there still might be cases hidden which lead to colors in the diff output. Is the file maybe only cleaned after fully written? |
It is indeed, though it depends on the report type used and such, but if there are colours to content with, the cleaning happens before the final file write.
Ah, glad you found that 😉 And that it helped clean up the code base.
I'd be happy to look at it if someone comes up with a good reproducible case (like the json one), but for now, I can't see this PR fixing anything. I'll close this PR now and wish you much success using PHP_CodeSniffer (and the fixer). |
I am using
to see some progress. In this case, it was not possible to switch of colors in the diff file.
Eventually related to #787
Description
Allow switching of colors in report files
Suggested changelog entry
Allow switching of colors in report files
Related issues/external references
Fixes #
Types of changes
PR checklist