mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-16 09:35:17 +00:00
Use the formatter prelude in more files (#6882)
Removes a bunch of imports that are made redundant by the prelude.
This commit is contained in:
parent
91a780c771
commit
edb9b0c62a
81 changed files with 139 additions and 230 deletions
|
@ -1,11 +1,10 @@
|
|||
use ruff_formatter::{write, Buffer, FormatResult};
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::PatternMatchAs;
|
||||
|
||||
use crate::comments::{dangling_comments, SourceComment};
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
use crate::prelude::*;
|
||||
use crate::{FormatNodeRule, PyFormatter};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatPatternMatchAs;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::comments::{dangling_comments, SourceComment};
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::{Pattern, PatternMatchClass, Ranged};
|
||||
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
|
||||
use crate::comments::{dangling_comments, SourceComment};
|
||||
use crate::expression::parentheses::{
|
||||
empty_parenthesized, parenthesized, NeedsParentheses, OptionalParentheses, Parentheses,
|
||||
};
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use ruff_formatter::{write, Buffer, FormatResult};
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::PatternMatchOr;
|
||||
|
||||
use crate::context::PyFormatContext;
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
use crate::{not_yet_implemented_custom_text, FormatNodeRule, PyFormatter};
|
||||
use crate::not_yet_implemented_custom_text;
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatPatternMatchOr;
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
use ruff_formatter::prelude::format_with;
|
||||
use ruff_formatter::{Format, FormatResult};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::{PatternMatchSequence, Ranged};
|
||||
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::TextRange;
|
||||
|
||||
use crate::builders::PyFormatterExtensions;
|
||||
use crate::context::PyFormatContext;
|
||||
use crate::expression::parentheses::{
|
||||
empty_parenthesized, optional_parentheses, parenthesized, NeedsParentheses, OptionalParentheses,
|
||||
};
|
||||
use crate::{FormatNodeRule, PyFormatter};
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatPatternMatchSequence;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::prelude::*;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::{Constant, PatternMatchSingleton};
|
||||
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
use crate::{FormatNodeRule, PyFormatter};
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatPatternMatchSingleton;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_formatter::{write, Buffer, FormatResult};
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::PatternMatchStar;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ use ruff_python_ast::PatternMatchValue;
|
|||
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses, Parentheses};
|
||||
use crate::prelude::*;
|
||||
use crate::{AsFormat, FormatNodeRule, PyFormatter};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatPatternMatchValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue