mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
Use FNV hasher in more places (#732)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
//! Options that the user can provide via pyproject.toml.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use fnv::FnvHashMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::checks_gen::CheckCodePrefix;
|
||||
@@ -29,5 +28,5 @@ pub struct Options {
|
||||
pub isort: Option<isort::settings::Options>,
|
||||
pub pep8_naming: Option<pep8_naming::settings::Options>,
|
||||
// Tables are required to go last.
|
||||
pub per_file_ignores: Option<BTreeMap<String, Vec<CheckCodePrefix>>>,
|
||||
pub per_file_ignores: Option<FnvHashMap<String, Vec<CheckCodePrefix>>>,
|
||||
}
|
||||
|
||||
@@ -96,12 +96,12 @@ pub fn load_options(pyproject: &Option<PathBuf>) -> Result<Options> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::BTreeMap;
|
||||
use std::env::current_dir;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::Result;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
use crate::checks_gen::CheckCodePrefix;
|
||||
use crate::flake8_quotes::settings::Quote;
|
||||
@@ -346,7 +346,7 @@ other-attribute = 1
|
||||
extend_select: None,
|
||||
ignore: None,
|
||||
extend_ignore: None,
|
||||
per_file_ignores: Some(BTreeMap::from([(
|
||||
per_file_ignores: Some(FnvHashMap::from_iter([(
|
||||
"__init__.py".to_string(),
|
||||
vec![CheckCodePrefix::F401]
|
||||
),])),
|
||||
|
||||
Reference in New Issue
Block a user