Skip to content

feature suggestion: add inherited attributes to (all) struct members #723

@Morg42

Description

@Morg42

Imagine a configuration like

item1:
  type: foo
  struct: 
  - plugin1.struct1
  - my.file1.struct1

Now, for some reason or other, you want all struct items to be (e.g.) cached, databased or update-enforced or the like.

You could

  • modify the plugins (or your own) struct definition
  • copy a plugins struct definition to your own and modify
  • add all struct items manually and add your attribute
  • ...?

Suggestion:

item1:
  type: foo
  struct:
  - plugin1.struct1
  - my.file1.struct1
  struct_attrs:
    - database: init
    - enforce_updates: true

item2:
  type: foo
  struct:
  - plugin1.struct1
     - database: init
     - enforce_updates: true
  - my.file1.struct1

This would apply the given attributes (database and enforce_updates) to all struct items (item1) or the plugin1.struct1-items (item2) respectively.

The first variant is easier to read, but can only be applied to all structs; variant 2 is less easy to read and more error-prone considering the more complex formatting, but can be applied more differentiated.

Maybe even other ways of defining attributes come to mind...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions