Move all module from the AST to the semantic crate (#11330)

This commit is contained in:
Micha Reiser 2024-05-08 10:56:50 +02:00 committed by GitHub
parent 8591adba11
commit 22639c5a2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 8 deletions

View file

@ -1,6 +1,7 @@
use ruff_python_ast::{all::DunderAllName, str::raw_contents_range};
use ruff_python_ast::str::raw_contents_range;
use ruff_text_size::{Ranged, TextRange};
use ruff_python_semantic::all::DunderAllName;
use ruff_python_semantic::{
BindingKind, ContextualizedDefinition, Definition, Export, Member, MemberKind,
};

View file

@ -38,7 +38,6 @@ use ruff_text_size::{Ranged, TextRange, TextSize};
use ruff_diagnostics::{Diagnostic, IsolationLevel};
use ruff_notebook::{CellOffsets, NotebookIndex};
use ruff_python_ast::all::{extract_all_names, DunderAllDefinition, DunderAllFlags};
use ruff_python_ast::helpers::{
collect_import_from_member, extract_handled_exceptions, is_docstring_stmt, to_module_path,
};
@ -50,6 +49,7 @@ use ruff_python_ast::{helpers, str, visitor, PySourceType};
use ruff_python_codegen::{Generator, Stylist};
use ruff_python_index::Indexer;
use ruff_python_parser::typing::{parse_type_annotation, AnnotationKind};
use ruff_python_semantic::all::{extract_all_names, DunderAllDefinition, DunderAllFlags};
use ruff_python_semantic::analyze::{imports, typing};
use ruff_python_semantic::{
BindingFlags, BindingId, BindingKind, Exceptions, Export, FromImport, Globals, Import, Module,

View file

@ -5,7 +5,6 @@ pub use int::*;
pub use node::{AnyNode, AnyNodeRef, AstNode, NodeKind};
pub use nodes::*;
pub mod all;
pub mod comparable;
pub mod docstrings;
mod expression;

View file

@ -1,8 +1,7 @@
use bitflags::bitflags;
use ruff_text_size::{Ranged, TextRange};
use crate::helpers::map_subscript;
use crate::{self as ast, Expr, Stmt};
use ruff_python_ast::{self as ast, helpers::map_subscript, Expr, Stmt};
use ruff_text_size::{Ranged, TextRange};
bitflags! {
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]

View file

@ -3,8 +3,8 @@ use std::ops::{Deref, DerefMut};
use bitflags::bitflags;
use crate::all::DunderAllName;
use ruff_index::{newtype_index, IndexSlice, IndexVec};
use ruff_python_ast::all::DunderAllName;
use ruff_python_ast::name::QualifiedName;
use ruff_python_ast::Stmt;
use ruff_source_file::Locator;

View file

@ -5,8 +5,9 @@ use std::fmt::Debug;
use std::ops::Deref;
use std::path::Path;
use crate::all::DunderAllName;
use ruff_index::{newtype_index, IndexSlice, IndexVec};
use ruff_python_ast::{self as ast, all::DunderAllName, Stmt};
use ruff_python_ast::{self as ast, Stmt};
use ruff_text_size::{Ranged, TextRange};
use crate::analyze::visibility::{

View file

@ -1,3 +1,4 @@
pub mod all;
pub mod analyze;
mod binding;
mod branches;