feat(pre-commit): adds pre-commit linting, yaml-compliance checking, …#10
feat(pre-commit): adds pre-commit linting, yaml-compliance checking, …#10Matt-Carre wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
============================================
+ Coverage 17.88% 100.00% +82.11%
============================================
Files 4 3 -1
Lines 123 22 -101
============================================
Hits 22 22
+ Misses 101 0 -101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5c82126 to
3636ca1
Compare
JamesDoingStuff
left a comment
There was a problem hiding this comment.
Good work! Got a few suggestions - hope you don't think me harsh, but you're getting the hang of this quickly so we have time to be thorough :)
| required_labels: list[str] = [ | ||
| r"apiVersion:\sargoproj\.io\/v1alpha", | ||
| r"kind:\sClusterWorkflowTemplate", | ||
| r"metadata:", | ||
| r"\s\sannotations:", | ||
| r"\s\s\s\sworkflows.argoproj.io/title:\s.+", | ||
| r"\s\s\s\sworkflows.diamond.ac.uk/repository:\s.+", | ||
| r"\s\slabels:", | ||
| r"\s\s\s\sworkflows.diamond.ac.uk/science-group-.+:\s.+", |
There was a problem hiding this comment.
I worry that using RegEx here will make things fragile - if the formatting changes to single tabs instead of double spaces, or if someone has the right label present in the template but put it under annotations by mistake etc. There's a python module that can parse yaml - may be worth a look?
|
Also, is there a reason for leaving file extensions off the scripts? I know they're not required, but I find them helpful to know what the contents looks like and to distinguish from binaries |
…yaml-regeneration, and environment variables