mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
Auto-generate formatter nodes for string parts (#8837)
A follow-up to auto-generate the `FormatNodeRule` implementation for the string part nodes. This is just a dummy implementation that is unreachable because it's handled by the parent nodes.
This commit is contained in:
parent
501cca8b72
commit
1dbfab9a0c
5 changed files with 139 additions and 0 deletions
12
crates/ruff_python_formatter/src/other/string_literal.rs
Normal file
12
crates/ruff_python_formatter/src/other/string_literal.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use ruff_python_ast::StringLiteral;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatStringLiteral;
|
||||
|
||||
impl FormatNodeRule<StringLiteral> for FormatStringLiteral {
|
||||
fn fmt_fields(&self, _item: &StringLiteral, _f: &mut PyFormatter) -> FormatResult<()> {
|
||||
unreachable!("Handled inside of `FormatExprStringLiteral`");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue