Skip to content

Can't configure quote style for ruff_python_codegen::Generator #20432

@ShaharNaveh

Description

@ShaharNaveh

There's support for creating a Generator from a Stylist instance:

#[derive(Debug, Clone)]
pub struct Stylist<'a> {
source: &'a str,
indentation: Indentation,
quote: Quote,
line_ending: OnceCell<LineEnding>,
}

impl<'a> From<&'a Stylist<'a>> for Generator<'a> {
fn from(stylist: &'a Stylist<'a>) -> Self {
Self {
indent: stylist.indentation(),
line_ending: stylist.line_ending(),
buffer: String::new(),
indent_depth: 0,
num_newlines: 0,
initial: true,
}
}
}

And while indentation and line_ending are being respected, quote is ignored:/


Motivation for issue: RustPython/RustPython#6124 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for support or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions