task icon indicating copy to clipboard operation
task copied to clipboard

feat: add linting and/or formatting check adherence to styleguide conventions

Open klauern opened this issue 6 years ago • 3 comments
trafficstars

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.

klauern avatar Nov 13 '19 13:11 klauern

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. 🙂

andreynering avatar Nov 16 '19 01:11 andreynering

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.

andreynering avatar Nov 08 '23 12:11 andreynering

I'm also very interested in this. Looks like there's some movement in that yamlfmt issue 🎉

iwittkau avatar Feb 04 '24 19:02 iwittkau