mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030)
This is a do-over of https://github.com/astral-sh/ruff/pull/8011, which I accidentally merged into a non-`main` branch. Sorry!
This commit is contained in:
parent
d85950ce5a
commit
d685107638
72 changed files with 76 additions and 75 deletions
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{write, FormatRuleWithOptions};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Constant, Expr, ExprAttribute, ExprConstant};
|
||||
use ruff_python_trivia::{find_only_token_in_range, SimpleTokenKind};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprAwait;
|
||||
|
||||
use crate::expression::maybe_parenthesize_expression;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Expr, ExprBinOp};
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{FormatOwnedWithRule, FormatRefWithRule};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{BoolOp, ExprBoolOp};
|
||||
|
||||
use crate::expression::binary_like::BinaryLike;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::FormatRuleWithOptions;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Expr, ExprCall};
|
||||
|
||||
use crate::comments::{dangling_comments, SourceComment};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{FormatOwnedWithRule, FormatRefWithRule};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{CmpOp, Expr, ExprCompare};
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::FormatRuleWithOptions;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Constant, ExprConstant};
|
||||
use ruff_text_size::{Ranged, TextLen, TextRange};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Expr, ExprDict};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprDictComp;
|
||||
use ruff_text_size::Ranged;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ use memchr::memchr2;
|
|||
|
||||
use crate::comments::SourceComment;
|
||||
use ruff_formatter::FormatResult;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprFString;
|
||||
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprFormattedValue;
|
||||
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write, FormatRuleWithOptions};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprGeneratorExp;
|
||||
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{write, FormatRuleWithOptions};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Expr, ExprIfExp};
|
||||
|
||||
use crate::comments::leading_comments;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprLambda;
|
||||
use ruff_text_size::Ranged;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::prelude::format_with;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprList;
|
||||
use ruff_text_size::Ranged;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write, FormatResult};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprListComp;
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{write, FormatContext};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprName;
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprNamedExpr;
|
||||
|
||||
use crate::comments::{dangling_comments, SourceComment};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprSet;
|
||||
use ruff_text_size::Ranged;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write, Buffer, FormatResult};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprSetComp;
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{write, FormatError};
|
||||
use ruff_python_ast::node::{AnyNodeRef, AstNode};
|
||||
use ruff_python_ast::{AnyNodeRef, AstNode};
|
||||
use ruff_python_ast::{Expr, ExprSlice, ExprUnaryOp, UnaryOp};
|
||||
use ruff_python_trivia::{SimpleToken, SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprStarred;
|
||||
|
||||
use crate::comments::{dangling_comments, SourceComment};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{write, FormatRuleWithOptions};
|
||||
use ruff_python_ast::node::{AnyNodeRef, AstNode};
|
||||
use ruff_python_ast::{AnyNodeRef, AstNode};
|
||||
use ruff_python_ast::{Expr, ExprSubscript};
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::{format_args, write, FormatRuleWithOptions};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprTuple;
|
||||
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprUnaryOp;
|
||||
use ruff_python_ast::UnaryOp;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Expr, ExprYield, ExprYieldFrom};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExprYieldFrom;
|
||||
|
||||
use crate::expression::expr_yield::AnyExpressionYield;
|
||||
|
|
|
@ -6,8 +6,8 @@ use ruff_formatter::{
|
|||
write, FormatOwnedWithRule, FormatRefWithRule, FormatRule, FormatRuleWithOptions,
|
||||
};
|
||||
use ruff_python_ast as ast;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::visitor::preorder::{walk_expr, PreorderVisitor};
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{Constant, Expr, ExpressionRef, Operator};
|
||||
use ruff_python_trivia::CommentRanges;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use ruff_formatter::prelude::tag::Condition;
|
||||
use ruff_formatter::{format_args, write, Argument, Arguments};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::ExpressionRef;
|
||||
use ruff_python_trivia::CommentRanges;
|
||||
use ruff_python_trivia::{
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::borrow::Cow;
|
|||
use bitflags::bitflags;
|
||||
|
||||
use ruff_formatter::{format_args, write, FormatError};
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{self as ast, Constant, ExprConstant, ExprFString, ExpressionRef};
|
||||
use ruff_python_parser::lexer::{lex_starts_at, LexicalError, LexicalErrorType};
|
||||
use ruff_python_parser::{Mode, Tok};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue