-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Always escape when writing pubspec.yaml's 'description' field. #130096
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
Always escape when writing pubspec.yaml's 'description' field. #130096
Conversation
christopherfujino
left a comment
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.
LGTM
andrewkolos
left a comment
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.
LGTM
|
Thanks! |
|
@matanlurey btw, you needed two org member approvals and for one of them to add the |
…er#130096) Closes flutter#80013. **Before**: ``` $ flutter create test1 --description "a: b" Creating project test1... Error detected in pubspec.yaml: Error on line 2, column 15: Mapping values are not allowed here. Did you miss a colon earlier? â�· 2 â�� description: a: b â�� ^ â�µ Please correct the pubspec.yaml file at /Users/matan/Developer/scratch/test1/pubspec.yaml ``` **After**: ``` $ flutter create test1 --description "a: b" Creating project test1... Resolving dependencies in test1... Got dependencies in test1. Wrote 129 files. All done! You can find general documentation for Flutter at: https://docs.flutter.dev/ Detailed API documentation is available at: https://api.flutter.dev/ If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev In order to run your application, type: $ cd test1 $ flutter run Your application code is in test1/lib/main.dart. ``` --- It's worth noting that this _always_ escapes a non-empty project description, which means that descriptions that were not previously wrapped in `"`s' will be. I'm not sure how worth it is to do a _conditional_ escape (i.e. only escape if not escaping would cause a problem), but willing to change. Side-note: I had no idea where to list this test in the (very large) `create_test.dart`, so I did my best :)
Closes #80013.
Before:
After:
It's worth noting that this always escapes a non-empty project description, which means that descriptions that were not previously wrapped in
"s' will be. I'm not sure how worth it is to do a conditional escape (i.e. only escape if not escaping would cause a problem), but willing to change.Side-note: I had no idea where to list this test in the (very large)
create_test.dart, so I did my best :)