nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: Y2Z/monolith
Pull request #460 (2025-03-30 02:28:28)

Don't remove leading dots from paths


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index c54d608..1d0bea8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1621,7 +1621,7 @@ dependencies = [
 
 [[package]]
 name = "monolith"
-version = "2.10.0"
+version = "2.10.1"
 dependencies = [
  "assert_cmd",
  "atty",
diff --git a/Cargo.toml b/Cargo.toml
index f9bc9c5..9a6030f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "monolith"
-version = "2.10.0"
+version = "2.10.1"
 authors = [
     "Sunshine <snshn@tutanota.com>",
     "Mahdi Robatipoor <mahdi.robatipoor@gmail.com>",
diff --git a/src/core.rs b/src/core.rs
index 6a9d7e6..81ab3b5 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -548,7 +548,6 @@ pub fn format_output_path(destination: &str, document_title: &str) -> String {
         .replace('\"', "")
         .replace('|', "-")
         .replace('?', "")
-        .trim_start_matches('.')
         .to_string()
 }
 


Test patch:
diff --git a/tests/core/format_output_path.rs b/tests/core/format_output_path.rs
index 5cc0d21..a7d94db 100644
--- a/tests/core/format_output_path.rs
+++ b/tests/core/format_output_path.rs
@@ -52,4 +52,11 @@ mod passing {
             r#"/home/username/Downloads/[] - -/__[] - -.html"#
         );
     }
+
+    #[test]
+    fn level_up() {
+        let final_destination = format_output_path(r#"../%title%.html"#, r#".Title"#);
+
+        assert_eq!(final_destination, r#"../Title.html"#);
+    }
 }