Skip to main content

Crate profmt

Crate profmt 

Source
Expand description

A fast, deterministic Protocol Buffers formatter built on tree-sitter.

Structs§

FormatOptions
Formatting policy used by crate::format_with_options.

Enums§

CommentSpacing
Spacing between // and the text of a line comment.
DeclarationSpacing
Whether block-bodied declarations are always set apart by blank lines.
EmptyBlockLayout
Layout of a block with no statements.
EmptyRpcBody
How an rpc with no options is terminated.
EmptyStatements
What happens to a ; that terminates nothing.
FieldOptionsLayout
Whether a field or enum value option list may break when it does not fit.
HeaderOrder
Order of the statements that open a file, up to the first message, enum, service or extend. syntax always comes first and file options always come last; the variants choose what sits between.
ImportOrder
Order of the import statements within the file header.
OptionValueLayout
Whether an option value may leave its statement’s line when the statement does not fit.
QuoteStyle
Preferred delimiter for string literals.
RpcSignatureLayout
Whether an rpc signature may break when it does not fit.

Functions§

format
format_with_options
is_formatted
Returns whether source is already formatted using the default policy, without allocating the rendered output.
is_formatted_with_options
Returns whether source is already formatted using options, without allocating the rendered output.