yamlfix icon indicating copy to clipboard operation
yamlfix copied to clipboard

Add a mode that exits nonzero for format violations instead of fixing

Open jamesliu4c opened this issue 10 months ago • 3 comments

Description

I'd like to have a CI check that yamlfix has been run by the dev. A lot of the rest of my CI infrastructure expects a nonzero exit code, like black --check.

Possible Solution

I read the docs, and this does not seem like an option. If it is a doc fix, that should be easy enough. Otherwise, i can probably make a PR for this as well.

Additional context

Related Issue

jamesliu4c avatar Apr 17 '24 18:04 jamesliu4c

This is already a feature: https://github.com/lyz-code/yamlfix/blob/main/src/yamlfix/entrypoints/cli.py#L41-L45

magnuslarsen avatar May 10 '24 10:05 magnuslarsen

Nice! I think me and @jamesliu4c missed this because there's no mention of this functionality on https://lyz-code.github.io/yamlfix/.

qerub avatar May 10 '24 13:05 qerub

Oh, nice. Thanks! Will you accept a PR to add it to the docs?

jamesliu4c avatar May 10 '24 14:05 jamesliu4c