Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr commentedSep 12, 2016
@fabpot fabbot seems to have failed. He wants me to add two spaces after the |
fabpot commentedSep 12, 2016
hmmm, I think fabbot drinks too much French wine :) Can you report the issue on FriendsOfPhp/php-cs-fixer? |
fabpot commentedSep 12, 2016
|
chalasr commentedSep 13, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@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! SeePHP-CS-Fixer/PHP-CS-Fixer#2177 |
fabpot commentedSep 13, 2016
@chalasr indeed, looks good to me. |
fabpot commentedSep 13, 2016
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/aSlashes 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:twigandlint:yamlcommands with theformatoption set tojson, giving such results:[ {"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:
[ {"file":"yaml/wrong/1.yml","valid":false,"message":"Unable to parse at line 1 (near\";:cc`\")." }]