Skip to content

Improve info output #250

Closed
Closed

Description

@MartinKl

The info function so far provides:

  • a modules attribute names
  • their description

This should be extended to avoid overloading the description with information that could be derived automatically. This includes:

  • the type of attribute (String, Integer, List of ..., ...)
  • whether or not an attribute is mandatory

Adding these will help keep frustration by trial and error low.

Activity

  1. MartinKl commented on Jun 24, 2024

    @MartinKl
    CollaboratorAuthor

    The best solution to this problem might actually a code style convention for Annatto (maybe even some kind of doc string template for fields) that forces contributors to mention TYPE and IS_REQUIRED (or whatever) in the doc string.

    Parsing field types and even worse, figuring out if they are required, seem to be sth undesirable in a language like Rust.

  2. MartinKl commented on Jun 24, 2024

    @MartinKl
    CollaboratorAuthor

    Another approach to think about a little bit is to refrain from using defaults for deserializable struct fields except for Option, thus using the latter would be a clear indicator of a field not being required. This, though, would have some weird implication for primitive types. bool as a type could be replaced by anything, since we'd only need to check for None vs. Some. For integer types, would we assume a difference between 0 and None or None always implies 0? As stated above, this needs some thinking about. On the contrary, we could not restrict types but always enforce there is a default, which does not work for path types (so we'd have to explicitly code around it) and does not make sense in all contexts (e. g. layer and name of annotation component arguments, the type usually can be thought of in default terms).

  3. MartinKl commented on Jun 25, 2024

    @MartinKl
    CollaboratorAuthor

    The current policy is to enforce default. Where defaut is not possible for fields, use Option

  4. locked and limited conversation to collaborators on Jun 25, 2024
  5. converted this issue into a discussion #255 on Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions