PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: census-instrumentation/opencensus-go (go)
Issue: remove golang.org/x/net/context from all non gRPC packages
Pull request description: Use stdlib context package for all non gRPC packages
For all non gRPC packages, import
  "context"
instead of
  "golang.org/x/net/context"

Fixes #199

Patch:
diff --git a/exporter/trace/stackdriver/stackdriver.go b/exporter/trace/stackdriver/stackdriver.go
index d0e8a80..dfd92be 100644
--- a/exporter/trace/stackdriver/stackdriver.go
+++ b/exporter/trace/stackdriver/stackdriver.go
@@ -30,6 +30,7 @@
 package stackdriver
 
 import (
+	"context"
 	"fmt"
 	"log"
 	"sync"
@@ -39,7 +40,6 @@ import (
 
 	tracingclient "cloud.google.com/go/trace/apiv2"
 	"go.opencensus.io/trace"
-	"golang.org/x/net/context"
 	"google.golang.org/api/option"
 	"google.golang.org/api/support/bundler"
 	tracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2"
diff --git a/tag/context.go b/tag/context.go
index 8add6d8..9fe32e4 100644
--- a/tag/context.go
+++ b/tag/context.go
@@ -15,7 +15,7 @@
 
 package tag
 
-import "golang.org/x/net/context"
+import "context"
 
 // FromContext returns the tag map stored in the context.
 func FromContext(ctx context.Context) *Map {
diff --git a/tag/map.go b/tag/map.go
index 06b10ef..a07d230 100644
--- a/tag/map.go
+++ b/tag/map.go
@@ -17,10 +17,9 @@ package tag
 
 import (
 	"bytes"
+	"context"
 	"fmt"
 	"sort"
-
-	"golang.org/x/net/context"
 )
 
 // Tag is a key value pair that can be propagated on wire.


Test patch:
diff --git a/stats/collector_test.go b/stats/collector_test.go
index bf56ee7..8382b59 100644
--- a/stats/collector_test.go
+++ b/stats/collector_test.go
@@ -15,10 +15,9 @@
 package stats
 
 import (
+	"context"
 	"testing"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/tag"
 )
 
diff --git a/stats/example_test.go b/stats/example_test.go
index 07938c9..f403389 100644
--- a/stats/example_test.go
+++ b/stats/example_test.go
@@ -15,11 +15,10 @@
 package stats_test
 
 import (
+	"context"
 	"log"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/stats"
 )
 
diff --git a/stats/view_test.go b/stats/view_test.go
index 4351e6f..8698b8a 100644
--- a/stats/view_test.go
+++ b/stats/view_test.go
@@ -16,11 +16,10 @@
 package stats
 
 import (
+	"context"
 	"testing"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/tag"
 )
 
diff --git a/stats/worker_test.go b/stats/worker_test.go
index 223a05d..a2d0595 100644
--- a/stats/worker_test.go
+++ b/stats/worker_test.go
@@ -16,6 +16,7 @@
 package stats
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"sync"
@@ -23,8 +24,6 @@ import (
 	"time"
 
 	"go.opencensus.io/tag"
-
-	"golang.org/x/net/context"
 )
 
 func Test_Worker_MeasureCreation(t *testing.T) {
Repository: rust-lang/rustfmt (rust)
Issue: Fn params are commented out with doc comments.
```text
$ git rev-parse HEAD
3d8cd57c2f166cb92204e95a5f4c73ab20fed4f2

$ cat example.rs
#[discard_params_doc]
trait Trait {
    fn foo(
        &self,
        /// some docs
        bar: String,
        /// another docs
        baz: i32,
    );
}

$ cargo run --bin rustfmt -- --edition=2018 < example.rs 2> /dev/null
#[discard_params_doc]
trait Trait {
    fn foo(&self, /// some docs bar: String, /// another docs baz: i32
    );
}
```

Normally doc comments on fn params triggers compile error. But it's ok if attribute macro discards it anyway... unless I run rustfmt on it.
Pull request description: handle param doc comments for macro scenarios
Fixes #4936 

Patch:
diff --git a/src/items.rs b/src/items.rs
index 6ba83b57..e8eb1c5d 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -1960,14 +1960,17 @@ impl Rewrite for ast::Param {
         let param_attrs_result = self
             .attrs
             .rewrite(context, Shape::legacy(shape.width, shape.indent))?;
-        let (span, has_multiple_attr_lines) = if !self.attrs.is_empty() {
+        // N.B. Doc comments aren't typically valid syntax, but could appear
+        // in the presence of certain macros - https://github.com/rust-lang/rustfmt/issues/4936
+        let (span, has_multiple_attr_lines, has_doc_comments) = if !self.attrs.is_empty() {
             let num_attrs = self.attrs.len();
             (
                 mk_sp(self.attrs[num_attrs - 1].span.hi(), self.pat.span.lo()),
                 param_attrs_result.contains('\n'),
+                self.attrs.iter().any(|a| a.is_doc_comment()),
             )
         } else {
-            (mk_sp(self.span.lo(), self.span.lo()), false)
+            (mk_sp(self.span.lo(), self.span.lo()), false, false)
         };
 
         if let Some(ref explicit_self) = self.to_self() {
@@ -1989,7 +1992,7 @@ impl Rewrite for ast::Param {
                 param_name,
                 span,
                 shape,
-                !has_multiple_attr_lines,
+                !has_multiple_attr_lines && !has_doc_comments,
             )?;
 
             if !is_empty_infer(&*self.ty, self.pat.span) {


Test patch:
diff --git a/tests/target/issue_4936.rs b/tests/target/issue_4936.rs
new file mode 100644
index 00000000..c19e505f
--- /dev/null
+++ b/tests/target/issue_4936.rs
@@ -0,0 +1,10 @@
+#[discard_params_doc]
+trait Trait {
+    fn foo(
+        &self,
+        /// some docs
+        bar: String,
+        /// another docs
+        baz: i32,
+    );
+}
Repository: eslint/doctrine (js)
Issue: Support nested brackets in default values
Intent is to support the following code:

```js
/**
 * @param {Array} [foo=[1]] this is a param
 */
```

Currently the default parsing ends at the first `]` regardless if other opening `[`s are encountered. JSDoc handles this syntax properly, and usejsdoc doesn't mention it but also doesn't forbid it in its discussion of default values.
Pull request description: Parse array default syntax
Fixes #133

this allows the code

    @param {Array} [foo=[1]] to properly be parsed

It does this by keeping track of bracket depth in the name parsing.

Patch:
diff --git a/lib/doctrine.js b/lib/doctrine.js
index 78f3ff0..c38830a 100644
--- a/lib/doctrine.js
+++ b/lib/doctrine.js
@@ -337,13 +337,21 @@
             }
 
             if (useBrackets) {
+
+
                 // do we have a default value for this?
                 if (source.charCodeAt(index) === 0x3D  /* '=' */) {
-
                     // consume the '='' symbol
                     name += advance();
+                    var bracketDepth = 1;
                     // scan in the default value
-                    while (index < last && source.charCodeAt(index) !== 0x5D  /* ']' */) {
+                    while (index < last) {
+                        if (source.charCodeAt(index) === 0x5B /* '[' */) {
+                            bracketDepth++;
+                        } else if (source.charCodeAt(index) === 0x5D  /* ']' */ &&
+                            --bracketDepth === 0) {
+                            break;
+                        }
                         name += advance();
                     }
                 }


Test patch:
diff --git a/test/parse.js b/test/parse.js
index c2311e7..7220af1 100644
--- a/test/parse.js
+++ b/test/parse.js
@@ -1921,6 +1921,28 @@ describe('optional params', function() {
         });
     });
 
+    it('default array', function() {
+        doctrine.parse(
+            ["/**", " * @param {String} [val=['foo']] some description", " */"].join('\n'),
+            { unwrap: true, sloppy: true}
+        ).should.eql({
+            "description": "",
+            "tags": [{
+                "title": "param",
+                "description": "some description",
+                "type": {
+                    "type": "OptionalType",
+                    "expression": {
+                        "type": "NameExpression",
+                        "name": "String"
+                    }
+                },
+                "name": "val",
+                "default": "['foo']"
+            }]
+        });
+    });
+
     it('line numbers', function() {
         var res = doctrine.parse(
             [