Running cnf-format -w foo.yaml writes different contents to file than what is checked, causing an always-fail situation.
$ nl foo.yaml
0001 Description: |-
0002 Foo
0003
0004 Bar
0005
0006 Baz
$ cfn-format -w foo.yaml 2>&1 | nl
0001 Semantic difference after formatting:
0002 (>) Description: |-
0003 Foo
0004
0005
0006 Bar
0007
0008
0009 Baz
0010
$ cfn-format -w foo.yaml 2>&1 | nl
0001 Semantic difference after formatting:
0002 (>) Description: |-
0003 Foo
0004
0005
0006 Bar
0007
0008
0009 Baz
0010
$ cfn-format -w foo.yaml 2>&1
Semantic difference after formatting:
(>) Description: |-
Foo
Bar
Baz
$ echo $?
1
$ nl foo.yaml
0001 Description: |-
0002 Foo
0003
0004 Bar
0005
0006 Baz