Skip to content

Commit

Permalink
Ignore trailing spaces when verifying format #13
Browse files Browse the repository at this point in the history
  • Loading branch information
stilvoid committed Oct 23, 2020
1 parent 9856b93 commit 7a47d74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/cfn-format/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"os"
"strings"

"github.com/aws-cloudformation/rain/cfn"
"github.com/aws-cloudformation/rain/cfn/format"
Expand Down Expand Up @@ -99,7 +100,7 @@ func main() {
if len(fileName) > 0 {
fmt.Fprint(os.Stderr, fileName+": ")
}
if string(input) == output {
if strings.TrimSpace(string(input)) == output {
fmt.Fprintln(os.Stderr, "formatted OK")
os.Exit(0)
} else {
Expand Down

0 comments on commit 7a47d74

Please sign in to comment.