ukf / ukf-testbed

UK federation tooling testbed
Apache License 2.0
1 stars 1 forks source link

Use yamllint #93

Open iay opened 2 months ago

iay commented 2 months ago

It's quite hard to keep consistent conventions across YAML files without a tool to help. I suggest we start using yamllint. This is configurable so the vast majority of things it currently flags (missing header line, long text lines) can be configured away to start with by adding a configuration file.

With those ignored, there seem to be a fair number of a couple of different kinds of indentation issue (which is to be expected, and actually the thing I had noticed myself), some stuff about "truthy" values and, curiously, a couple of cases where it notices files with CRLF termination instead of LF.

As well as manual runs, we can consider adding it to the CI.

Longer term, we can consider making it stricter.

philsmart commented 2 months ago

Good plan. Mine can be all over the place, I try to make them consistent, but...

philsmart commented 2 months ago

Is this the one: https://yamllint.readthedocs.io/en/stable/. I can brew install that.

iay commented 2 months ago

That's the one. As well as Homebrew, it's also just a Python thing so it's easy to install for CI work.

It will pick up configuration files from the current directory if you name them correctly, so you can start easy (excluding some rules, files or even directories) and tighten up as you go. So it's possible to start using it without a lot of investment.