Skip to content
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

remove TOML and JSON support? #34

Closed
andreynering opened this issue Jul 2, 2017 · 15 comments
Closed

remove TOML and JSON support? #34

andreynering opened this issue Jul 2, 2017 · 15 comments

Comments

@andreynering
Copy link
Member

Maintaining different formats is getting complicated after #32, specially with TOML, that is a very inflexible format.

This was asked long ago, but I don't think anyone are actually using it.

I'm asking here if anyone have a problem with it first.

/cc @tscholl2 @sascha-andres @smyrman @zbindenren

@andreynering andreynering added the type: question Further information is requested. label Jul 2, 2017
@andreynering andreynering mentioned this issue Jul 2, 2017
4 tasks
@tscholl2
Copy link

tscholl2 commented Jul 2, 2017

I'm not using this, but I think it's great people are still working on it. So if you drop TOML/JSON then it doesn't bother me. Thanks for asking though!

Also I looked at the issue you mentioned. I wasn't sure if this would work, but could you just unmarshal a json file, then marshal it into a yaml string, then unmarshal it using the custom yaml unmarshaler? I might be misunderstanding what's involved though, I didn't read that closely.

@smyrman
Copy link
Contributor

smyrman commented Jul 3, 2017

I don't have a problem with TOML support, or even JSON, being dropped.

@sascha-andres
Copy link
Contributor

I tend to use YAML everywhere as I personally like expressiveness and structure a log. Therefore it would not bother me.

Besides I think supporting one thing right is a better approach as opposed to make it work for everyone ( TOML, JSON and YAML ) with limitations due to the lowest common features.

@andreynering
Copy link
Member Author

Thanks for the feedback. I'll drop them soon in the next release, so this don't block us in new features and refactorings.

@smyrman
Copy link
Contributor

smyrman commented Jul 3, 2017

Just to reply @tscholl2

Also I looked at the issue you mentioned. I wasn't sure if this would work, but could you just unmarshal a json file, then marshal it into a yaml string, then unmarshal it using the custom yaml unmarshaler? I might be misunderstanding what's involved though, I didn't read that closely.

You probably could do that, but it's probably somewhat error prone. Another option could be to have an UnmarshalJSON(data []byte) error implementation for the type(s) that needs it that does the following:

  1. Validates correct JSON, and maybe replace all tabs with two spaces.
  2. Calls UnmarshalYAML(data []byte) error with the sanitised data.

Most JSON (unless perhaps if it's indented by tabs) will be considered valid YAML. However, this still leads to having to support two formats.

@zbindenren
Copy link
Contributor

I also just use yaml.

@zbindenren
Copy link
Contributor

Travis-ci and gitlab-ci only have yaml support. So I think people are quite familiar with it.

andreynering added a commit that referenced this issue Jul 4, 2017
andreynering added a commit that referenced this issue Jul 5, 2017
@andreynering
Copy link
Member Author

Done on master branch

@earthboundkid
Copy link

Oh no! I use TOML. Is it too late to switch back? 😢

@andreynering
Copy link
Member Author

I'm sorry for that @carlmjohnson

I know backward incompatible changes are a pain, and I usually thought well before doing them.

Unfortunally TOML and JSON are not as full featured as YAML, and we don't plan to support other formats soon.

You can convert your files to YAML to keep using Task.

@runeimp
Copy link

runeimp commented Aug 7, 2017

@carlmjohnson Checkout Remarshal to get help you get started on the conversion. I rather like TOML for simple config bit agree that YAML is much better for enhancing task.

@earthboundkid
Copy link

I ended up converting my TOML to YAML with Remarshall on my own, but thanks for the advice. 😄

@earthboundkid
Copy link

BTW, you can see my Taskfile linked in my blog post: https://blog.carlmjohnson.net/post/2017/hugo-asset-pipeline/

@andreynering
Copy link
Member Author

@carlmjohnson I saw your article and added it to the README.

Just more info about why I prefer YAML for Task (in case someone else comes to this issue):

  • You can easily write multiline string. In YAML we have the pipe operator |, but on JSON you'd have to add uglies \n
  • You can break big non-multiline string in multiple lines
  • TOML in very inflexible, and don't allow much customization in the Go side
  • JSON disallow comments
  • etc...

@runeimp
Copy link

runeimp commented Aug 7, 2017

@carlmjohnson Yeah, didn't realize your comment was almost two weeks old before I posted. BTW, nice article! ;-)

@pd93 pd93 removed the type: question Further information is requested. label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants