mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-13 05:47:06 +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
|
@ -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";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue