Giter VIP home page Giter VIP logo

Comments (4)

aguschin avatar aguschin commented on September 27, 2024 2

Ok, so I've created a TYPE_ALLOWED setting in #87. I think it's a way to deal with these, and we could add something on top like asking Did you mean "model"? if user entered "models". But don't think it's needed right now. I'll close the issue and we'll address this in future if that would be needed. Thanks for posting the feedback @omesser!

from gto.

aguschin avatar aguschin commented on September 27, 2024 1

Thanks!

  1. I've implemented gto audit registrations as you suggested, everything works now. I've also supported shortcuts and aliases, like:
class ALIASES:
    REGISTER = ["reg", "registration", "registrations", "register"]
    PROMOTE = ["prom", "promote", "promotion", "promotions"]

Do you think it's fine to support them? I mean, people will rely on them and if we decide to remove some of them in future, it can break user's workflow. On other hand in k8s you also have this kind of shortcuts and they are very helpful.

  1. In fact, model and models may be different things. Maybe I have a model (models/my-model) and models (models/). So not sure we need to assume it's a 100% typo. (This example also touches interleaved paths, but we can discuss it here #59).

I have few options in mind here:
A. Make a spell-check and warn you when you do that, so you can spot in and fix it before you commit this.
B. Allow to specify a whitelist of allowed values. Then if you make a typo, gto will throw an error.
C. Same as A, but if we think this may be a typo, we throw an error and ask you to use --force flag.

WDYT?

from gto.

omesser avatar omesser commented on September 27, 2024 1

"Do you think it's fine to support them? I mean, people will rely on them and if we decide to remove some of them in future"

I believe it's a better experience to support the aliases. But we can still be consistent with the syntax in the docs (meaning always using "registrations" everywhere, and mention the aliases only once).
We will need to, indeed, not remove those in the future - or at least manage deprecations properly.
Another, "safer" route, is to explicitly mention in the docs that we only commit to a specific form of the arg = "registration", and not aliases like "reg" "registrations". I think both are valid approaches, but I think the aliases route has proved itself so convenient in some cases that it should be regarded as a production feature (just my personal 2 cents)

from gto.

omesser avatar omesser commented on September 27, 2024 1

"In fact, model and models may be different things...."

This is why i originally wrote that this is debatable, but I think pluralization of types shouldn't be so close to a possible typo (like model and models).
Type should always be singular, if we ever want to deal with a set of models as a distinct type, the new type can be called model-set (or list? depends) - then you both accommodate for a collection of items but prevent easily made typos

from gto.

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.