Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Yaml] deprecated usage of @ and ` at the beginning of an unquoted string #16285

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

Merged
merged 1 commit into from
Oct 28, 2015

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Oct 19, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #16234
License MIT
Doc PR n/a

@stof
Copy link
Member

stof commented Oct 19, 2015

👍

@Tobion
Copy link
Contributor

Tobion commented Oct 19, 2015

I'm not sure it's worth to remove the @ functionality considering the high impact as said in #16234 (comment)

I assume there will be ALOT of bundles that are affected that all would not be compatible with 3.0 without adjustments. And adding quotes arguments: - "@my_other_service" also doesn't look that nice. So maybe we should only do this change for "`" but live with the fact that @ is not according to spec.

@fabpot
Copy link
Member Author

fabpot commented Oct 19, 2015

@Tobion we must be as compliant as possible as people use other languages (like Ruby and Python) in their stack. As adding quotes is easy enough and BC for everyone, I think we need to do this now; it's indeed going to be a bit painful but I think it's worth it.

@@ -4,6 +4,7 @@ CHANGELOG
2.8.0
-----

* Deprecated usage of @ and ` at the beginning of an unquoted string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should escape the backtick here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github seems to handle it just fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only as long as you don't add another one in the file. They handle it only because they cannot find the corresponding one.

@fabpot
Copy link
Member Author

fabpot commented Oct 20, 2015

ping @symfony/deciders

@dunglas
Copy link
Member

dunglas commented Oct 20, 2015

👍 I agree we should do it now. However, as it will affect almost all bundles and docs out right now it would be nice to provide a rock-solid sed command to do automatically the change in the UPGRADE file.

@aitboudad aitboudad added the Yaml label Oct 20, 2015
@aitboudad
Copy link
Contributor

👍

I see another case (the usage of % at the beginning of an unquoted string) where I think we should deprecate.

services:
    foo.baz:
        class: %baz_class%

@xabbuh
Copy link
Member

xabbuh commented Oct 20, 2015

@aitboudad Afaik there is nothing special with the % character in scalars (there was in YAML 1.1 IIRC though).

Edit: Revoked my +1 because of the failing tests (see below).

@xabbuh
Copy link
Member

xabbuh commented Oct 20, 2015

It seems that we have some fixture files that need an update.

@aitboudad
Copy link
Contributor

@xabbuh you're right, I tested with 1.2

@stof
Copy link
Member

stof commented Oct 20, 2015

@aitboudad the reason why we had to quote them in the documentation is because Pygments implemented its Yaml syntax highlighter based on Yaml 1.1, and has not updated it for 1.2. But it is indeed not an issue.

@OskarStark
Copy link
Contributor

👍 @dunglas , such sed command would be great 😄

xabbuh added a commit to symfony/symfony-docs that referenced this pull request Oct 27, 2015
This PR was squashed before being merged into the 2.3 branch (closes #5843).

Discussion
----------

Fixed the YAML syntax for service references

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | -

See symfony/symfony#16285 and symfony/symfony#16353 for context. I've just found two issues, but it's possible that this syntax is used in more places.

Commits
-------

daeda56 Fixed the YAML syntax for service references
@fabpot fabpot force-pushed the yaml-deps branch 3 times, most recently from 162f095 to 8df1aa9 Compare October 28, 2015 04:18
@fabpot fabpot merged commit 7fee29f into symfony:2.8 Oct 28, 2015
fabpot added a commit that referenced this pull request Oct 28, 2015
… an unquoted string (fabpot)

This PR was merged into the 2.8 branch.

Discussion
----------

[Yaml] deprecated usage of @ and ` at the beginning of an unquoted string

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #16234
| License       | MIT
| Doc PR        | n/a

Commits
-------

7fee29f [Yaml] deprecated usage of @ and ` at the beginning of an unquoted string
Tobion added a commit that referenced this pull request Oct 28, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

[Yaml] escape backtick in markdown changelog

| Q             | A
| ------------- | ---
| Fixed tickets | #16285
| License       | MIT

Commits
-------

a613b0d [Yaml] escape backtick in markdown changelog
@fabpot fabpot mentioned this pull request Nov 16, 2015
pguso added a commit to pguso/LswApiCallerBundle that referenced this pull request Dec 17, 2015
Error Message:
The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line

Related to pull request:
symfony/symfony#16285
@gepo
Copy link
Contributor

gepo commented Jan 14, 2016

Oneliner to change it in all Yaml files:

find ./ -name '*.yml' -exec sed -i '' -E 's/([^"])@([a-z\._]+)($|\]| |,)/\1"@\2"\3/g' {} +

@OskarStark
Copy link
Contributor

thank you @gepo

@TomasVotruba
Copy link
Contributor

@gepo Thanks for a tip

marc1706 added a commit to marc1706/phpbb that referenced this pull request Jul 23, 2016
This type of use was deprecated in symfony 2.8 and will be dropped in 3.x.
Also see: symfony/symfony#16285

PHPBB3-14717
symfony-splitter pushed a commit to phpbb/phpbb-app that referenced this pull request Jul 23, 2016
This type of use was deprecated in symfony 2.8 and will be dropped in 3.x.
Also see: symfony/symfony#16285

PHPBB3-14717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants