Skip to content

Commit

Permalink
chore: better format defaults
Browse files Browse the repository at this point in the history
- don't append new line at the end and keep the content as it is
- default retain line breaks for readability since format itself is all about readability
  • Loading branch information
longkai committed Sep 11, 2022
1 parent 6da562a commit 3982c3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func RunCommand(
if err != nil {
return err
}
fmt.Println(string(out))
fmt.Print(string(out))
}

return nil
Expand Down
5 changes: 3 additions & 2 deletions formatters/basic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func DefaultConfig() *Config {
lineBreakStyle = yamlfmt.LineBreakStyleCRLF
}
return &Config{
Indent: 2,
LineEnding: lineBreakStyle,
Indent: 2,
LineEnding: lineBreakStyle,
RetainLineBreaks: true,
}
}

0 comments on commit 3982c3c

Please sign in to comment.