PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: eslint/doctrine (js)
Issue: Last tag always has \n in the description
Hi,

the `unwrap: true` option fails to strip the last new line before `*/`, so an empty description on the last tag in the comment always becomes '/' (not sure why) and a non-empty description always has a newline at the end.

In my code, I have to do this to remove spaces/newlines from before the end of the comment, before passing the comment to doctrine.
     
     comment = comment.replace(/[\s\n]*\*\/[\s\n]*$/, '*/');


Thanks
Pull request description: Fix: Last tag always has \n in the description
Fixes #87.

Not sure if this is the best fix so open to suggestions.

Patch:
diff --git a/lib/doctrine.js b/lib/doctrine.js
index 01187c2..78f3ff0 100644
--- a/lib/doctrine.js
+++ b/lib/doctrine.js
@@ -159,7 +159,7 @@
             index += 1;
         }
 
-        return result;
+        return result.replace(/\s+$/, '');
     }
 
     // JSDoc Tag Parser


Test patch:
diff --git a/test/unwrap.js b/test/unwrap.js
index 03d6f6d..82f9396 100644
--- a/test/unwrap.js
+++ b/test/unwrap.js
@@ -33,7 +33,7 @@ require('should');
 
 describe('unwrapComment', function () {
   it('normal', function () {
-    doctrine.unwrapComment('/**\n * @const\n * @const\n */').should.equal('\n@const\n@const\n');
+    doctrine.unwrapComment('/**\n * @const\n * @const\n */').should.equal('\n@const\n@const');
   });
 
   it('single', function () {
@@ -46,15 +46,15 @@ describe('unwrapComment', function () {
   });
 
   it('2 lines', function () {
-    doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\ny\n');
+    doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\ny');
   });
 
   it('2 lines with space', function () {
-    doctrine.unwrapComment('/**x\n *    y\n*/').should.equal('x\n   y\n');
+    doctrine.unwrapComment('/**x\n *    y\n*/').should.equal('x\n   y');
   });
 
   it('3 lines with blank line', function () {
-    doctrine.unwrapComment('/**x\n *\n \* y\n*/').should.equal('x\n\ny\n');
+    doctrine.unwrapComment('/**x\n *\n \* y\n*/').should.equal('x\n\ny');
   });
 });
 /* vim: set sw=4 ts=4 et tw=80 : */
Repository: rsteube/carapace (go)
Issue: elvish: elvish: empty argument fix not needed anymore
seems this is not needed anymore in the completion script and rather causes an error

```elvish
if (eq $arg[-1] "") {
    arg[-1] = "''"
}
```

Pull request description: elvish: removed empty parameter fix
fix #226


Patch:
diff --git a/internal/elvish/snippet.go b/internal/elvish/snippet.go
index 3610ec3..0b73239 100644
--- a/internal/elvish/snippet.go
+++ b/internal/elvish/snippet.go
@@ -8,9 +8,6 @@ import (
 
 func Snippet(cmd *cobra.Command, actions map[string]string) string {
 	return fmt.Sprintf(`edit:completion:arg-completer[%v] = [@arg]{
-    if (eq $arg[-1] "") {
-        arg[-1] = "''"
-    }
     %v _carapace elvish _ (all $arg) | from-json | all (one) | each [c]{ edit:complex-candidate $c[Value] &display=$c[Display] }
 }
 `, cmd.Name(), uid.Executable())


Test patch:
diff --git a/example/cmd/_test/elvish.elv b/example/cmd/_test/elvish.elv
index 5580805..3987d19 100644
--- a/example/cmd/_test/elvish.elv
+++ b/example/cmd/_test/elvish.elv
@@ -1,7 +1,4 @@
 edit:completion:arg-completer[example] = [@arg]{
-    if (eq $arg[-1] "") {
-        arg[-1] = "''"
-    }
     example _carapace elvish _ (all $arg) | from-json | all (one) | each [c]{ edit:complex-candidate $c[Value] &display=$c[Display] }
 }
Repository: shapesecurity/salvation (java)
Issue: 'self' in source list is not resolved during the optimisation
Example: 
policy `object-src example.com *` served by example.com is optimised to empty policy ""

`object-src 'self' *` remains unmodofied
Pull request description: fixes #81: optimise policy while adding
set current version to 1.0.2

Patch:
diff --git a/pom.xml b/pom.xml
index 67ba48f..aeb2656 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
 
     <groupId>com.shapesecurity</groupId>
     <artifactId>salvation</artifactId>
-    <version>1.0.1</version>
+    <version>1.0.2</version>
     <packaging>jar</packaging>
 
     <name>salvation</name>
diff --git a/src/main/java/com/shapesecurity/salvation/data/Policy.java b/src/main/java/com/shapesecurity/salvation/data/Policy.java
index d960031..c4dc44e 100644
--- a/src/main/java/com/shapesecurity/salvation/data/Policy.java
+++ b/src/main/java/com/shapesecurity/salvation/data/Policy.java
@@ -266,6 +266,7 @@ public class Policy implements Show {
         if (directive == null) {
             this.directives.put(d.getClass(), d);
             this.expandDefaultSrc();
+            this.resolveSelf();
             this.optimise();
         }
     }


Test patch:
diff --git a/src/test/java/com/shapesecurity/salvation/ParserTest.java b/src/test/java/com/shapesecurity/salvation/ParserTest.java
index 9ef67db..cbcc82f 100644
--- a/src/test/java/com/shapesecurity/salvation/ParserTest.java
+++ b/src/test/java/com/shapesecurity/salvation/ParserTest.java
@@ -148,6 +148,11 @@ public class ParserTest extends CSPTest {
         assertEquals("directive-name, host-source a:*", "script-src a:*", parseAndShow("script-src a:*"));
         assertEquals("directive-name, host-source http://a:*", "script-src http://a:*", parseAndShow("script-src http://a:*"));
 
+        // GH-81 should pass
+        assertEquals("optimisation", "", parseAndShow("script-src example.com *"));
+        assertEquals("optimisation", "", parseAndShow("script-src 'self' *"));
+
+
     }
 
     @Test