task
task copied to clipboard
feat: add linting and/or formatting check adherence to styleguide conventions
It would be nice to see a lint or -lint option that you can pass to task so you can check your file against your proposed Styleguide. Would be useful for CI/CD checks as well.
Hi @klauern,
That's indeed an interesting idea.
The YAML formatting rules can be a bit tricky to test, though. I don't if go-yaml/yaml would allow us to check if there are empty lines between tasks, if 2 spaces indentation is used, etc.
So, this needs a bit of investigation on how we'd implement it. 🙂
I just found out that there's a package for YAML formatting from Google: https://github.com/google/yamlfmt
It seems that it'd be possible to import as a library and have a builtin format flag from Task.
We need to see if it supports everything we need. For example: this open issue would ideally have to be implemented: https://github.com/google/yamlfmt/issues/152.
I'm also very interested in this. Looks like there's some movement in that yamlfmt issue 🎉