Files
ruff/crates/ruff_python_formatter/src/statement/stmt_pass.rs
Charlie Marsh edb9b0c62a Use the formatter prelude in more files (#6882)
Removes a bunch of imports that are made redundant by the prelude.
2023-08-25 16:51:07 -04:00

22 lines
550 B
Rust

use ruff_python_ast::StmtPass;
use crate::comments::{SourceComment, SuppressionKind};
use crate::prelude::*;
#[derive(Default)]
pub struct FormatStmtPass;
impl FormatNodeRule<StmtPass> for FormatStmtPass {
fn fmt_fields(&self, _item: &StmtPass, f: &mut PyFormatter) -> FormatResult<()> {
text("pass").fmt(f)
}
fn is_suppressed(
&self,
trailing_comments: &[SourceComment],
context: &PyFormatContext,
) -> bool {
SuppressionKind::has_skip_comment(trailing_comments, context.source())
}
}