Open sbaudoin opened 10 months ago
I'm going to push additional commits. For a cleaner history, will you do the rebase or should I do it on my side?
About the rational behind check-scalars
, this came from the same code extract as the one you give:
foo:
-broken
From a YAML point of view this is a valid scalar syntax but as we see that the scalar starts with an hyphen we may think this syntax is a typo. On the first sight we may think that hyphen-min-spaces
will identify that but not as we are not considering a sequence because this is a scalar. So I added check-scalars
to be able to check such situations. But I agree that this might lead to poor performances and may trigger a lot of false positive (that's explain in the doc).
From my point of view, hyphen-min-spaces
would be incomplete without this additional option; we can go without it but we must be clear about such situations not being taken into account.
I'm going to push additional commits. For a cleaner history, will you do the rebase or should I do it on my side?
OK! The best would be to rebase and squash into one commit with a nice title, ready to be merged.
From my point of view,
hyphen-min-spaces
would be incomplete without this additional option; we can go without it but we must be clear about such situations not being taken into account.
Thanks for the explanation.
I'm +1 to be more clear about such situations not taken into account (and the reason is simple: they are valid YAML). The quoted-strings
rule can also be enabled to avoid such problems.
This permits checking style when people want sequences to have a fixed number of spaces greater than 1 for example. We may also use these options to identify typos where we expect everything starting with an hyphen to be a sequence.