Skip to content

Commit

Permalink
undo unwanted changes that I left in
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonk committed Oct 31, 2024
1 parent d82c7ab commit 06b7764
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
2 changes: 0 additions & 2 deletions formatters/basic/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package basic
import (
"bytes"
"errors"
"fmt"
"io"

"github.com/braydonk/yaml"
Expand Down Expand Up @@ -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)
}
Expand Down
25 changes: 0 additions & 25 deletions formatters/basic/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package basic_test

import (
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -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")
}
}

0 comments on commit 06b7764

Please sign in to comment.