Expand description
Deterministic, rule-based formatter for the R language.
This crate is the formatting engine of arity, extracted so that other tools (e.g. a dprint plugin) can embed it. Output is decided solely by the formatter’s rules and its best-fit layout engine; the input’s existing line breaks never influence the result. The target style is the tidyverse R style guide.
The primary entry points are [format] and format_with_style, configured
via FormatStyle. Their format_verified counterparts additionally
check normalized syntax, ordinary comments, and idempotence. With the
serde feature, FormatStyle is (de)serializable; the schema feature
additionally derives schemars::JsonSchema.
A package’s DESCRIPTION is a second grammar with its own entry point,
format_description; see formatter::description.
Re-exports§
pub use formatter::DeclineReason;pub use formatter::DescriptionFormatError;pub use formatter::FormatAnalysis;pub use formatter::FormatError;pub use formatter::FormatStyle;pub use formatter::FormatVerificationError;pub use formatter::LineEnding;pub use formatter::RangeFormatted;pub use formatter::analyze_format_with_options;pub use formatter::format;pub use formatter::format_description;pub use formatter::format_description_with_style;pub use formatter::format_node;pub use formatter::format_range;pub use formatter::format_verified;pub use formatter::format_verified_with_options;pub use formatter::format_verified_with_style;pub use formatter::format_with_options;pub use formatter::format_with_style;pub use rowan;
Modules§
- ast
- Re-export of
arity_parser::astso internalcrate::astpaths resolve. - dcf
- Re-export of
arity_parser::dcf, the second grammar, socrate::dcfpaths resolve here the waycrate::parserandcrate::syntaxalready do. - formatter
- parser
- Re-export of
arity_parser::parserso internalcrate::parserpaths resolve. - syntax
- Re-export of
arity_parser::syntaxso internalcrate::syntaxpaths resolve.