Giter Club home page Giter Club logo

Comments (15)

sascha-andres avatar sascha-andres commented on May 18, 2024 1

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.

from task.

tscholl2 avatar tscholl2 commented on May 18, 2024

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.

from task.

smyrman avatar smyrman commented on May 18, 2024

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

from task.

andreynering avatar andreynering commented on May 18, 2024

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

from task.

smyrman avatar smyrman commented on May 18, 2024

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.

from task.

zbindenren avatar zbindenren commented on May 18, 2024

I also just use yaml.

from task.

zbindenren avatar zbindenren commented on May 18, 2024

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

from task.

andreynering avatar andreynering commented on May 18, 2024

Done on master branch

from task.

earthboundkid avatar earthboundkid commented on May 18, 2024

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

from task.

andreynering avatar andreynering commented on May 18, 2024

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.

from task.

runeimp avatar runeimp commented on May 18, 2024

@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.

from task.

earthboundkid avatar earthboundkid commented on May 18, 2024

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

from task.

earthboundkid avatar earthboundkid commented on May 18, 2024

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

from task.

andreynering avatar andreynering commented on May 18, 2024

@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...

from task.

runeimp avatar runeimp commented on May 18, 2024

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

from task.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.