-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml][TwigBridge] Use JSON_UNESCAPED_SLASHES for lint commands output #19922
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
@fabpot fabbot seems to have failed. He wants me to add two spaces after the |
hmmm, I think fabbot drinks too much French wine :) Can you report the issue on FriendsOfPhp/php-cs-fixer? |
|
@fabpot There is already a check for JSON_PRETTY_PRINT which has been introduced in the same time, I guess it's fine to add the two if one of them is defined, isn't it? :)
Sure! See PHP-CS-Fixer/PHP-CS-Fixer#2177 |
@chalasr indeed, looks good to me. |
Thank you @chalasr. |
…mands output (chalasr) This PR was merged into the 2.7 branch. Discussion ---------- [Yaml][TwigBridge] Use JSON_UNESCAPED_SLASHES for lint commands output | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Slashes are escaped when sing the `lint:twig` and `lint:yaml` commands with the `format` option set to `json`, giving such results: ```json [ { "file": "yaml\/wrong\/1.yml", "valid": false, "message": "Unable to parse at line 1 (near \";:cc`\")." } ] ``` That's not convenient as file paths may be reused (e.g. copy-pasted). Results stay fine as error messages are already escaped: ```json [ { "file": "yaml/wrong/1.yml", "valid": false, "message": "Unable to parse at line 1 (near \";:cc`\")." } ] ``` Commits ------- 0427594 Use JSON_UNESCAPED_SLASHES for lint commands output
Slashes are escaped when sing the
lint:twig
andlint:yaml
commands with theformat
option set tojson
, giving such results:That's not convenient as file paths may be reused (e.g. copy-pasted).
Results stay fine as error messages are already escaped: