HopkinsIDD / flepiMoP

The Flexible Epidemic Modeling Pipeline
https://flepimop.org
GNU General Public License v3.0
9 stars 4 forks source link

[Feature request]: YAML Linting #343

Open TimothyWillard opened 1 week ago

TimothyWillard commented 1 week ago

Label

enhancement, meta/workflow

Priority Label

low priority

Is your feature request related to a problem? Please describe.

We use a lot of YAML throughout flepiMoP and associated repos for configuration, GitHub actions, etc. These files are inconsistently formatted in many cases that hurts readability. For example:

twillard@epid-iss-MacBook-Pro ~/D/G/H/flepiMoP (main)> uvx yamllint . | wc -l
     971
twillard@epid-iss-MacBook-Pro ~/D/G/H/flepiMoP (main)> uvx yamllint --no-warnings . | wc -l
     681

Don't take the absolute numbers super seriously since this also captures meta describing which files these are located in, maybe the true number is 10-20% less then these.

Is your feature request related to a new application, scenario round, pathogen? Please describe.

n/a

Describe the solution you'd like

Add linting of YAML contained within this repository to enforce consistency. Seems like the most popular choice is yamllint. They recommend using yamlfix to do "auto fixing" which will help get us started. They even have good documentation on how to integrate with GitHub actions.

I think ultimately having this only in the flepiMoP repo will not be sufficient, but serves as a good starting point before moving them to a organization-level shared workflow in HopkinsIDD or ACCIDDA.

pearsonca commented 1 week ago

Agree. This will be especially critical as we start including, for example, a model library for reuse

jcblemai commented 2 days ago

Agree, this is very important. Let's just keep in mind that most configs are automatically generated by flepiconfig, so as a step after fixing up the configs in the repo, we should open a follow-up issue on flepiconfig issuing linted config files.

TimothyWillard commented 2 days ago

Let's just keep in mind that most configs are automatically generated by flepiconfig,

Oh, that's good to know. In that case I think the strategy is to implement unit testing for flepiconfig that comes with assertions that the outputs produced are yamllint compliant and then come back and convert the past configs.