mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 20:09:22 +00:00
Rename ruff_python_semantic's Context
struct to SemanticModel
(#4565)
This commit is contained in:
parent
3238743a7b
commit
19c4b7bee6
304 changed files with 1253 additions and 1142 deletions
|
@ -3,6 +3,8 @@ use std::str::FromStr;
|
|||
|
||||
use clap::{command, Parser};
|
||||
use regex::Regex;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use ruff::logging::LogLevel;
|
||||
use ruff::registry::Rule;
|
||||
use ruff::resolver::ConfigProcessor;
|
||||
|
@ -11,7 +13,6 @@ use ruff::settings::types::{
|
|||
FilePattern, PatternPrefixPair, PerFileIgnore, PythonVersion, SerializationFormat,
|
||||
};
|
||||
use ruff::RuleSelector;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
|
|
|
@ -2,23 +2,24 @@ use std::cell::RefCell;
|
|||
use std::fs;
|
||||
use std::hash::Hasher;
|
||||
use std::io::Write;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::Result;
|
||||
use filetime::FileTime;
|
||||
use log::error;
|
||||
use path_absolutize::Absolutize;
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use serde::ser::{SerializeSeq, SerializeStruct};
|
||||
use serde::{Deserialize, Serialize, Serializer};
|
||||
|
||||
use ruff::message::Message;
|
||||
use ruff::settings::{AllSettings, Settings};
|
||||
use ruff_cache::{CacheKey, CacheKeyHasher};
|
||||
use ruff_diagnostics::{DiagnosticKind, Fix};
|
||||
use ruff_python_ast::imports::ImportMap;
|
||||
use ruff_python_ast::source_code::SourceFileBuilder;
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use serde::ser::{SerializeSeq, SerializeStruct};
|
||||
use serde::{Deserialize, Serialize, Serializer};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::ExitStatus;
|
||||
use ruff::settings::options::Options;
|
||||
|
||||
use crate::ExitStatus;
|
||||
|
||||
#[allow(clippy::print_stdout)]
|
||||
pub(crate) fn config(key: Option<&str>) -> ExitStatus {
|
||||
match key {
|
||||
|
|
|
@ -388,9 +388,10 @@ fn check(args: CheckArgs, log_level: LogLevel) -> Result<ExitStatus> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod test_file_change_detector {
|
||||
use crate::{change_detected, ChangeKind};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::{change_detected, ChangeKind};
|
||||
|
||||
#[test]
|
||||
fn detect_correct_file_change() {
|
||||
assert_eq!(
|
||||
|
|
|
@ -11,9 +11,10 @@ use std::{fs, process, str};
|
|||
use anyhow::{anyhow, Context, Result};
|
||||
use assert_cmd::Command;
|
||||
use log::info;
|
||||
use ruff::logging::{set_up_logging, LogLevel};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
use ruff::logging::{set_up_logging, LogLevel};
|
||||
|
||||
/// Handles `blackd` process and allows submitting code to it for formatting.
|
||||
struct Blackd {
|
||||
address: SocketAddr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue