Documentation
¶
Overview ¶
Package formatter is what powers jsonnetfmt, a Jsonnet formatter. It works similar to most other code formatters. Basically said, it takes the contents of a file and returns them properly formatted. Behaviour can be customized using formatter.Options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommentStyle ¶
type CommentStyle = formatter.CommentStyle
CommentStyle controls how the reformatter rewrites comments. Comments that look like a #! hashbang are always left alone.
const ( // CommentStyleHash means #. CommentStyleHash CommentStyle = iota // CommentStyleSlash means //. CommentStyleSlash // CommentStyleLeave means comments are left as they are found. CommentStyleLeave )
type Options ¶
Options is a set of parameters that control the reformatter's behaviour.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the recommended formatter behaviour.
type StringStyle ¶
type StringStyle = formatter.StringStyle
StringStyle controls how the reformatter rewrites string literals. Strings that contain a ' or a " use the optimal syntax to avoid escaping those characters.
const ( // StringStyleDouble means "this". StringStyleDouble StringStyle = iota // StringStyleSingle means 'this'. StringStyleSingle // StringStyleLeave means strings are left how they were found. StringStyleLeave )