mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Run automatically format code blocks with Black (#3191)
This commit is contained in:
parent
386ca7c9a1
commit
d285f5c90a
66 changed files with 420 additions and 394 deletions
|
@ -21,9 +21,9 @@ pub struct Document {
|
|||
|
||||
impl Document {
|
||||
/// Sets [`expand`](tag::Group::expand) to [`GroupMode::Propagated`] if the group contains any of:
|
||||
/// * a group with [`expand`](tag::Group::expand) set to [GroupMode::Propagated] or [GroupMode::Expand].
|
||||
/// * a non-soft [line break](FormatElement::Line) with mode [LineMode::Hard], [LineMode::Empty], or [LineMode::Literal].
|
||||
/// * a [FormatElement::ExpandParent]
|
||||
/// - a group with [`expand`](tag::Group::expand) set to [GroupMode::Propagated] or [GroupMode::Expand].
|
||||
/// - a non-soft [line break](FormatElement::Line) with mode [LineMode::Hard], [LineMode::Empty], or [LineMode::Literal].
|
||||
/// - a [FormatElement::ExpandParent]
|
||||
///
|
||||
/// [`BestFitting`] elements act as expand boundaries, meaning that the fact that a
|
||||
/// [`BestFitting`]'s content expands is not propagated past the [`BestFitting`] element.
|
||||
|
|
|
@ -29,8 +29,8 @@ pub enum Tag {
|
|||
EndDedent,
|
||||
|
||||
/// Creates a logical group where its content is either consistently printed:
|
||||
/// * on a single line: Omitting `LineMode::Soft` line breaks and printing spaces for `LineMode::SoftOrSpace`
|
||||
/// * on multiple lines: Printing all line breaks
|
||||
/// - on a single line: Omitting `LineMode::Soft` line breaks and printing spaces for `LineMode::SoftOrSpace`
|
||||
/// - on multiple lines: Printing all line breaks
|
||||
///
|
||||
/// See [crate::builders::group] for documentation and examples.
|
||||
StartGroup(Group),
|
||||
|
@ -203,8 +203,8 @@ pub enum DedentMode {
|
|||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Condition {
|
||||
/// * Flat -> Omitted if the enclosing group is a multiline group, printed for groups fitting on a single line
|
||||
/// * Multiline -> Omitted if the enclosing group fits on a single line, printed if the group breaks over multiple lines.
|
||||
/// - Flat -> Omitted if the enclosing group is a multiline group, printed for groups fitting on a single line
|
||||
/// - Multiline -> Omitted if the enclosing group fits on a single line, printed if the group breaks over multiple lines.
|
||||
pub(crate) mode: PrintMode,
|
||||
|
||||
/// The id of the group for which it should check if it breaks or not. The group must appear in the document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue