-
Notifications
You must be signed in to change notification settings - Fork 437
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
Add color on phpcsfixer #1025
base: v2.x
Are you sure you want to change the base?
Add color on phpcsfixer #1025
Conversation
bf054c0
to
295014c
Compare
src/Task/PhpCsFixer.php
Outdated
@@ -71,11 +71,12 @@ public function run(ContextInterface $context): TaskResultInterface | |||
$this->formatter->resetCounter(); | |||
|
|||
$arguments = $this->processBuilder->createArgumentsForCommand('php-cs-fixer'); | |||
$arguments->add('--format=json'); | |||
$arguments->add('--format=txt'); |
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 think this task is using a dedicated formatter (GrumPHP\Formatter\PhpCsFixerFormatter), that this change will break
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.
Indeed, this will bypass the custom formatter.
However, the formatter is quite old and was used to propose a way of fixing the code.
Now that we have our fixer configuration - which used the process to build de fixer process - it seems safe to nuke that custom formatter. It doesn't really provide any benefits anymore + it seems better to rely on the official php-cs-fixer formatters.
@oallain : Can you:
- remove the custom formatter and it's implementation
- provide a configurable
format
string option with a default oftxt
- add documentation for these options?
Do we need to specify --ansi
?
Normally the system is smart enough to detect ansi or not.
295014c
to
49da91d
Compare
Hello @veewee I tried to do what you asked. As for the "--ansi" yes, if not, it doesn't work. |
I probably did not describe it well enough :) However, I don't think we need the custom Instead we could use the raw php-cs-fixer output and print the additionel Hope this makes it a bit more clear. Feel free to ask questions if not :) |
We notices this PR became inactive. If you wish to continue, feel free to pick it up again. |
Hello,
A picture is worth a thousand words, I let you see the result, which is so much more pleasant.
Before
After
The inspiration comes from ECS.
grumphp/src/Task/Ecs.php
Line 71 in 3ec61c1