Allow tab_width to be configable (#7016)

This commit is contained in:
magic-akari 2023-08-31 15:40:03 +08:00 committed by GitHub
parent 92143afeee
commit f4ba0ea144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,6 +94,12 @@ impl PyFormatOptions {
self.source_map_generation self.source_map_generation
} }
#[must_use]
pub fn with_tab_width(mut self, tab_width: TabWidth) -> Self {
self.tab_width = tab_width;
self
}
#[must_use] #[must_use]
pub fn with_quote_style(mut self, style: QuoteStyle) -> Self { pub fn with_quote_style(mut self, style: QuoteStyle) -> Self {
self.quote_style = style; self.quote_style = style;