Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML and LinkML auto-formatting and enumeration auto-describing #871

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

turbomam
Copy link
Member

@turbomam turbomam commented Oct 8, 2024

This PR adds a mechanism for

  • normalizing the YAML format of mixs.yaml
  • using a succinct LinkML for for dictionaries like prefixes
  • omitting inferrable meatslots like the text of permissible values

It also inherits auto-describing of any enum that lacks a description from

For future discussion:

  • do we want empty curly brackets for keys without values?
  • be careful about patterns that are longer than the current max line length , 79
    -what technology should we use to check that?
  • how to visualize the changes from yamlfmt (or the previous steps?)

@turbomam turbomam marked this pull request as draft October 8, 2024 20:51
@turbomam turbomam marked this pull request as ready for review October 8, 2024 21:03
@turbomam turbomam requested a review from sujaypatil96 October 9, 2024 19:07
Makefile Show resolved Hide resolved
Makefile Outdated
Comment on lines 163 to 175
yq eval '(.. | select(has("from_schema")) | .from_schema) style="" | del(.. | select(has("from_schema")).from_schema)' |\
yq eval '.classes[] |= select(has("annotations")).annotations |= map_values(.value)' |\
yq eval '.prefixes |= map_values(.prefix_reference)' |\
yq eval '.settings |= map_values(.setting_value)' |\
yq eval '.slots[] |= select(has("annotations")).annotations |= map_values(.value)' |\
yq eval 'del(.classes.[].name)' |\
yq eval 'del(.classes.[].slot_usage.[].name)' |\
yq eval 'del(.enums.[].name)' |\
yq eval 'del(.enums.[].permissible_values.[].text)' |\
yq eval 'del(.slots.[].domain)' |\
yq eval 'del(.slots.[].name)' |\
yq eval 'del(.source_file)' |\
yq eval 'del(.subsets.[].name)' |\
Copy link
Collaborator

Choose a reason for hiding this comment

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

These yq clean up/tidying steps are great!! 🧹

@turbomam turbomam changed the title formatting changes only YAML and LinkML auto-formatting and enumeration auto-naming Oct 14, 2024
@turbomam turbomam changed the title YAML and LinkML auto-formatting and enumeration auto-naming YAML and LinkML auto-formatting and enumeration auto-describing Oct 14, 2024
@sujaypatil96 sujaypatil96 self-requested a review October 15, 2024 16:46
@sujaypatil96
Copy link
Collaborator

@turbomam to split it out into 2 PRs.

@jfy133
Copy link
Collaborator

jfy133 commented Nov 29, 2024

More autoformatting the better! Does this then occur/get applied during GitHub actions validation?

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.

3 participants