Skip to content

Metadata API: Provide type as well as _type#1376

Merged
joshuagl merged 1 commit intotheupdateframework:developfrom
jku:duplicate-type-property
May 10, 2021
Merged

Metadata API: Provide type as well as _type#1376
joshuagl merged 1 commit intotheupdateframework:developfrom
jku:duplicate-type-property

Conversation

@jku
Copy link
Copy Markdown
Member

@jku jku commented May 7, 2021

Using Metadata APIs '_type' attribute (from outside metadata.py) currently
results in linter errors.

Add a duplicate 'type': this way the API users can avoid linter errors
but '_type' is still available in case the strict file format
compatibility is needed.

Fixes #1375

Signed-off-by: Jussi Kukkonen jkukkonen@vmware.com


I think the only alternative to this that I would consider acceptable is just replacing _type with type.

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

@jku jku force-pushed the duplicate-type-property branch from f5599c3 to b77d6da Compare May 7, 2021 13:04
Using Metadata APIs '_type' attribute (from outside metadata.py) currently
results in linter errors.

Add a duplicate 'type': this way the API users can avoid linter errors
but '_type' is still available in case the strict file format
compatibility is needed.

Fixes theupdateframework#1375

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
@jku jku force-pushed the duplicate-type-property branch from b77d6da to 85971be Compare May 10, 2021 11:12
Copy link
Copy Markdown
Collaborator

@MVrachev MVrachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that _type is read-only that's okay.
LGTM!

Copy link
Copy Markdown
Member

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable as a convenience API to avoid having to disable classes of linter warnings.

@joshuagl joshuagl merged commit d5deba2 into theupdateframework:develop May 10, 2021
@jku jku deleted the duplicate-type-property branch December 30, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata API: linting _type is an issue for API users

3 participants