diff --git a/formatters/basic/formatter.go b/formatters/basic/formatter.go index 442e758..377409b 100644 --- a/formatters/basic/formatter.go +++ b/formatters/basic/formatter.go @@ -17,7 +17,6 @@ package basic import ( "bytes" "errors" - "fmt" "io" "github.com/braydonk/yaml" @@ -103,7 +102,6 @@ func (f *BasicFormatter) getNewEncoder(buf *bytes.Buffer) *yaml.Encoder { e.SetWidth(f.Config.LineLength) } - fmt.Println(f.Config.LineEnding) if f.Config.LineEnding == yamlfmt.LineBreakStyleCRLF { e.SetLineBreakStyle(yaml.LineBreakStyleCRLF) } diff --git a/formatters/basic/formatter_test.go b/formatters/basic/formatter_test.go index 32ed0c4..ba01175 100644 --- a/formatters/basic/formatter_test.go +++ b/formatters/basic/formatter_test.go @@ -15,7 +15,6 @@ package basic_test import ( - "runtime" "strings" "testing" @@ -352,27 +351,3 @@ b: 2 t.Fatalf("expected: '%s', got: '%s'", expectedYml, resultStr) } } - -func TestWindowsEOFNewlineCRLFBug(t *testing.T) { - if runtime.GOOS != "windows" { - t.Skip("this test is Windows specific") - } - - config := basic.DefaultConfig() - config.RetainLineBreaks = false - config.EOFNewline = true - config.LineEnding = yamlfmt.LineBreakStyleLF - f := newFormatter(config) - - yml := `a: 1 -b: 2` - - result, err := f.Format([]byte(yml)) - if err != nil { - t.Fatalf("expected formatting to pass, returned error: %v", err) - } - resultStr := string(result) - if strings.Contains(resultStr, "\r") { - t.Fatalf("expected: no CRLF, found it") - } -}