From b438c8fd589d5d24e318ab02cebec5732065ad64 Mon Sep 17 00:00:00 2001 From: ia0 Date: Fri, 30 Jun 2023 21:49:46 +0200 Subject: [PATCH] Do not change the extension of catalog paths This creates conflicting rules. Fixes #413 --- crates/taplo-common/src/schema/associations.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/crates/taplo-common/src/schema/associations.rs b/crates/taplo-common/src/schema/associations.rs index 39e23d2b2..75d4110c5 100644 --- a/crates/taplo-common/src/schema/associations.rs +++ b/crates/taplo-common/src/schema/associations.rs @@ -444,25 +444,9 @@ pub enum SchemaCatalog { impl SchemaCatalog { fn transform_paths(&mut self) { - // Common extensions that can be replaced with "toml". - const COMMON_EXTENSIONS: &[&str] = &["yaml", "yml", "json"]; - if let SchemaCatalog::SchemaStore(index) = self { for s in &mut index.schemas { for fm in &mut s.file_match { - // Replace extensions with toml. - if Path::new(fm).extension().is_some() { - let ext = fm.rsplit('.').next().unwrap(); - let ext_len = ext.len(); - if COMMON_EXTENSIONS - .iter() - .any(|common_ext| ext.eq_ignore_ascii_case(common_ext)) - { - fm.truncate(fm.len() - ext_len); - *fm += "toml"; - } - } - if !fm.starts_with("**/") { *fm = String::from("**/") + fm.as_str(); }