Documentation
¶
Overview ¶
Package scriptfmt is the one format every managed script is stored in (#1937): the Starlark printer from github.com/bazelbuild/buildtools, without its rewrites, applied on every save so no agent has to think about layout and no diff between two versions is noise.
It lays the source out and changes nothing else: keyword arguments are written key = value, the items of a multi-line list or dict go one per line, strings take double quotes, and every comment is kept. The rewrites the printer can also apply (sorting some lists and load statements) are for Bazel BUILD files and are not used, since reordering a script's lists could change what it does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format returns source in the canonical format. The printed source is used only when the dialect parses it into the same program -- the same syntax tree, literal values and comments -- as the source sent; otherwise the source is returned as it was. The dialect is the authority on what a script is, so a save is never refused, and never changed in meaning, because of how the printer laid it out.
Types ¶
This section is empty.