From f4ba0ea1440416b196d5be3124ad7a015ace8db6 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Thu, 31 Aug 2023 15:40:03 +0800 Subject: [PATCH] Allow `tab_width` to be configable (#7016) --- crates/ruff_python_formatter/src/options.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ruff_python_formatter/src/options.rs b/crates/ruff_python_formatter/src/options.rs index fe7c7a9e86..14d9fea415 100644 --- a/crates/ruff_python_formatter/src/options.rs +++ b/crates/ruff_python_formatter/src/options.rs @@ -94,6 +94,12 @@ impl PyFormatOptions { 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] pub fn with_quote_style(mut self, style: QuoteStyle) -> Self { self.quote_style = style;