Giter Club home page Giter Club logo

recipe's People

Contributors

jbedard avatar kormide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

7u4 qasimtalkin

recipe's Issues

Not enough information when cake does not contain key or when key is ambigous

In Cake.java L.83 & L.86:

else if (candidates.isEmpty()) {
            throw new RuntimeException("cake does not contain key '" + fullKey + "'");
        }
        else {
            throw new RuntimeException("cannot retrieve ambiguous key '" + fullKey + "'");
        }

when candidates is empty, can you append the full list of cake keys so it's easier to diagnose what went wrong?

When there are more than one candidates, can you append the list of candidates so it's easy to see why its ambigious?

Oven is swallowing the exception messages

Oven.java L.46

catch (Exception e) {
            throw new RuntimeException("could not bake cake", e);
        }

I'd like to be able to see e's cause message as this is more interesting in debugging purposes than "could not bake cake"

Ambiguous Key Error for keys that are suffix to other keys

Steps to Reproduce
Key two resources, where one is a suffix of the other, e.g. AB and B. Then, try to get the id of B.

For example:

Cake cake = oven.bake(Recipe.prepare(
   new mySetup1(...).keyed("B"),
   new mySetup1(...).keyed("AB"),
));

cake.get("B") // throws ambiguous key error

Problem
I think the problem is how we determine the list of key match candidates in Cake.java: List<String> candidates = entries.keySet().stream().filter(k -> k.endsWith(fullKey)).collect(Collectors.toList());.

Using language keywords should cause a yaml exception

Steps to Reproduce

  • In a parameter use a language keyword. For example, public when generating java setups or one of the ones from microsoft/TypeScript#2536 if generating typescript setups
- name: Example
    required:
      - name: public
        type: string
    initializers:
      - params: ["public"]

Expected
A generation failure with the line/column number pointing to the yaml so its easy to figure out which param is incorrect and why

Actual
A compilation failure in the generated code

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.