Rename ruff_python_semantic's Context struct to SemanticModel (#4565)

This commit is contained in:
Charlie Marsh 2023-05-21 22:35:03 -04:00 committed by GitHub
parent 3238743a7b
commit 19c4b7bee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
304 changed files with 1253 additions and 1142 deletions

View file

@ -1,22 +1,25 @@
mod generator;
mod indexer;
mod line_index;
mod locator;
mod stylist;
use std::fmt::{Debug, Formatter};
use std::sync::Arc;
pub use crate::source_code::line_index::{LineIndex, OneIndexed};
pub use generator::Generator;
pub use indexer::Indexer;
pub use locator::Locator;
use ruff_text_size::{TextRange, TextSize};
use rustpython_parser as parser;
use rustpython_parser::{lexer, Mode, ParseError};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::fmt::{Debug, Formatter};
use std::sync::Arc;
pub use generator::Generator;
pub use indexer::Indexer;
pub use locator::Locator;
pub use stylist::{Quote, Stylist};
pub use crate::source_code::line_index::{LineIndex, OneIndexed};
mod generator;
mod indexer;
mod line_index;
mod locator;
mod stylist;
/// Run round-trip source code generation on a given Python code.
pub fn round_trip(code: &str, source_path: &str) -> Result<String, ParseError> {
let locator = Locator::new(code);