mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 08:04:26 -05:00
Rename ruff_python_semantic's Context struct to SemanticModel (#4565)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use itertools::Itertools;
|
||||
use regex::Regex;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
||||
@@ -7,6 +5,9 @@ use std::hash::{Hash, Hasher};
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use itertools::Itertools;
|
||||
use regex::Regex;
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct CacheKeyHasher {
|
||||
inner: DefaultHasher,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use crate::{CacheKey, CacheKeyHasher};
|
||||
use filetime::FileTime;
|
||||
use std::hash::Hash;
|
||||
|
||||
use filetime::FileTime;
|
||||
|
||||
use crate::{CacheKey, CacheKeyHasher};
|
||||
|
||||
impl CacheKey for FileTime {
|
||||
fn cache_key(&self, state: &mut CacheKeyHasher) {
|
||||
self.hash(&mut **state);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::{CacheKey, CacheKeyHasher};
|
||||
use globset::{Glob, GlobMatcher};
|
||||
|
||||
use crate::{CacheKey, CacheKeyHasher};
|
||||
|
||||
impl CacheKey for GlobMatcher {
|
||||
fn cache_key(&self, state: &mut CacheKeyHasher) {
|
||||
self.glob().cache_key(state);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
mod cache_key;
|
||||
pub mod filetime;
|
||||
pub mod globset;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub use cache_key::{CacheKey, CacheKeyHasher};
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
mod cache_key;
|
||||
pub mod filetime;
|
||||
pub mod globset;
|
||||
|
||||
pub const CACHE_DIR_NAME: &str = ".ruff_cache";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user