mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Improve Ruff Formatter Interoperability (#6472)
This commit is contained in:
parent
50dab9cea6
commit
dc3275fe7f
2 changed files with 43 additions and 4 deletions
|
@ -92,7 +92,13 @@ impl FromStr for IndentStyle {
|
|||
"tab" | "Tabs" => Ok(Self::Tab),
|
||||
"space" | "Spaces" => Ok(Self::Space(IndentStyle::DEFAULT_SPACES)),
|
||||
// TODO: replace this error with a diagnostic
|
||||
_ => Err("Value not supported for IndentStyle"),
|
||||
v => {
|
||||
let v = v.strip_prefix("Spaces, size: ").unwrap_or(v);
|
||||
|
||||
u8::from_str(v)
|
||||
.map(Self::Space)
|
||||
.map_err(|_| "Value not supported for IndentStyle")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue