-
Notifications
You must be signed in to change notification settings - Fork 16
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
Pretty please can we keep comments in pubspec.yaml #4
Comments
There is an upstream feature request alexei-sintotski/pubspec_yaml#22 Some thoughts on the topic. I have not seen any yaml writers in Dart able to keep formatting or comments. As a workaround, we can probably search for a line like |
I just had a quick look at I like the idea of heuristically and minimally changing the document. It might even be made robust, in which case you could completely get rid of the |
@rubenvereecken sure, contributions are always welcomed. This is one is indeed non trivial. A simple regex can probably solve 99% of the cases, but that 1% might be tricky. name: my_silly_package
version: '1.2.3' # i am the version line
description: 'This is a hypothetical package that changes lines like
version: 1.2.3
into
version: "1.2.3"
'
homepage: https://example.com Which line to change here? |
I happen to have a bit of experience with lexers though I'm afraid Dart
will have limited support in the way of packages. I'll have a look after
the weekend.
…On Fri, 31 Jul 2020, 20:12 The Конь, ***@***.***> wrote:
@rubenvereecken <https://github.com/rubenvereecken> sure, contributions
are always welcomed. This is one is indeed non trivial. A simple regex can
probably solve 99% of the cases, but that 1% might be tricky.
version: "1.2.3" # i am the version linedescription: 'This is a hypothetical package that changes lines likeversion: 3.2.1intoversion: "1.2.3"'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHZSKIBXOD53KTJASZDWHDR6MJTPANCNFSM4PNJBESA>
.
|
Yes, ideally this should be solved in the upstream dependencies. I'm not aware of any yaml parser/writer in Dart which supports comments or any extensive formatting. |
The issue should be fixed in 0.0.3. Please confirm. |
I desperately need a tool like this. Looks clean and neat and seems to do the job well. I don't mind the reformatting, that's a result of rewriting, but pretty please can it keep comments. I've got a flutter project and there are some really good links to documentation in the
pubspec.yaml
file that I don't want to lose.The text was updated successfully, but these errors were encountered: