mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:42:02 +00:00
Support glob patterns in pep8_naming ignore-names (#5024)
## Summary Support glob patterns in pep8_naming ignore-names. Closes #2787 ## Test Plan Added new tests.
This commit is contained in:
parent
65312bad01
commit
b0f89fa814
29 changed files with 482 additions and 22 deletions
|
@ -5,6 +5,7 @@ use std::hash::{Hash, Hasher};
|
|||
use std::ops::{Deref, DerefMut};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use glob::Pattern;
|
||||
use itertools::Itertools;
|
||||
use regex::Regex;
|
||||
|
||||
|
@ -375,3 +376,9 @@ impl CacheKey for Regex {
|
|||
self.as_str().cache_key(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl CacheKey for Pattern {
|
||||
fn cache_key(&self, state: &mut CacheKeyHasher) {
|
||||
self.as_str().cache_key(state);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue