Skip to content

Doesn't handle whitespace consistently between check and file write #20

Description

@danielhoherd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions