Git Product home page Git Product logo

Comments (10)

jhass avatar jhass commented on May 16, 2024

It should be

name: amethyst
version: 0.1.7

dependencies:
  mime:
    github: spalger/crystal-mime
    branch: master

We still need to better validate the format.

from shards.

ysbaddaden avatar ysbaddaden commented on May 16, 2024

Yes, but reporting correct error messages is hard. Here we'd have "config for github dependency must be a hash", which is better than "cast to X error" but still kinda weird.

Unless we can have the code that failed parsing and pointing arrows, like crystal compiler errors? Maybe the experimental yaml_mapping could help with that?

from shards.

jhass avatar jhass commented on May 16, 2024

Maybe we can track the rough section and provide generic error messages? Like

Invalid shard.yml: Invalid dependencies. Specifying dependencies should look like this:

dependencies:
  example:
    github: crystal-lang/example-shard
    version: 0.1.0

from shards.

ysbaddaden avatar ysbaddaden commented on May 16, 2024

👍 very good idea.

from shards.

asterite avatar asterite commented on May 16, 2024

Another idea is to use a pull parser, so you can access the line and column. I think the yaml format of shards is pretty simple and it could be done. With this, we can show errors like in the compiler. It shouldn't be that hard to do. If you want I can give it a try.

from shards.

sdogruyol avatar sdogruyol commented on May 16, 2024

Thanks @jhass

I also agree on more meaningful error message.

from shards.

sdogruyol avatar sdogruyol commented on May 16, 2024

Meanwhile does every shard.yml have to have name and description in it?

Doing this also fails

dependencies:
  mime:
    github: spalger/crystal-mime
    branch: master

from shards.

jhass avatar jhass commented on May 16, 2024

I think name and version is the minimum

from shards.

ysbaddaden avatar ysbaddaden commented on May 16, 2024

Yes, both name and version are required. Everything else is optional.

from shards.

ysbaddaden avatar ysbaddaden commented on May 16, 2024

Closing since 658da8a now displays nicer parse errors.

from shards.

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.