Fix typo in relative-imports-order option name

This commit is contained in:
Charlie Marsh 2023-01-12 15:57:58 -05:00
parent 3110d342c7
commit 590bec57f4
4 changed files with 4 additions and 4 deletions

View file

@ -1024,7 +1024,7 @@
"description": "Place \"closer\" imports (fewer `.` characters, most local) before \"further\" imports (more `.` characters, least local).",
"type": "string",
"enum": [
"closest-to-further"
"closest-to-furthest"
]
},
{

View file

@ -943,7 +943,7 @@ mod tests {
.as_path(),
&Settings {
isort: isort::settings::Settings {
relative_imports_order: RelatveImportsOrder::ClosestToFurther,
relative_imports_order: RelatveImportsOrder::ClosestToFurthest,
..isort::settings::Settings::default()
},
src: vec![Path::new("resources/test/fixtures/isort").to_path_buf()],

View file

@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
pub enum RelatveImportsOrder {
/// Place "closer" imports (fewer `.` characters, most local) before
/// "further" imports (more `.` characters, least local).
ClosestToFurther,
ClosestToFurthest,
/// Place "further" imports (more `.` characters, least local) imports
/// before "closer" imports (fewer `.` characters, most local).
FurthestToClosest,

View file

@ -60,7 +60,7 @@ pub fn cmp_levels(
(None, Some(_)) => Ordering::Less,
(Some(_), None) => Ordering::Greater,
(Some(level1), Some(level2)) => match relative_imports_order {
RelatveImportsOrder::ClosestToFurther => level1.cmp(level2),
RelatveImportsOrder::ClosestToFurthest => level1.cmp(level2),
RelatveImportsOrder::FurthestToClosest => level2.cmp(level1),
},
}