PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: tighten/tlint (php)
Issue: NoRequestAll incorrectly identifies $request->user()
I have recently created a new Laravel 9.6.0 project, installed Jetstream Inertia, then added Tighten/TLint. I created a custom Preset to include more linters including Linters\NoRequestAll.

This linter now identifies the following code as violating NoRequestAll:

```
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
```

Pull request description: Fix no `$request-all()` check
This PR aims to fix #285.



Patch:
diff --git a/src/Linters/NoRequestAll.php b/src/Linters/NoRequestAll.php
index 96c2a73..1fe487e 100644
--- a/src/Linters/NoRequestAll.php
+++ b/src/Linters/NoRequestAll.php
@@ -19,9 +19,10 @@ class NoRequestAll extends BaseLinter
         $traverser = new NodeTraverser;
 
         $traverser->addVisitor($visitor = new FindingVisitor(function (Node $node) {
-            return ($node instanceof MethodCall && (string) $node->var->name === 'request')
-                || ($node instanceof StaticCall && (string) $node->class === 'Request')
-                && $node->name->name === 'all';
+            $isRequestMethodCall = $node instanceof MethodCall && (string) $node->var->name === 'request';
+            $isRequestStaticCall = $node instanceof StaticCall && (string) $node->class === 'Request';
+
+            return ($isRequestMethodCall || $isRequestStaticCall) && $node->name->name === 'all';
         }));
 
         $traverser->traverse($parser->parse($this->code));


Test patch:
diff --git a/tests/Linting/Linters/NoRequestAllTest.php b/tests/Linting/Linters/NoRequestAllTest.php
index 4432b89..90b1bd3 100644
--- a/tests/Linting/Linters/NoRequestAllTest.php
+++ b/tests/Linting/Linters/NoRequestAllTest.php
@@ -83,4 +83,24 @@ file;
 
         $this->assertEquals(11, $lints[0]->getNode()->getLine());
     }
+
+    /** @test */
+    public function allows_other_request_methods()
+    {
+        $file = <<<'file'
+<?php
+
+Route::get('/user', function (Request $request) {
+    $user = $request->user();
+    $method = $request->method();
+    $keys = $request->keys();
+
+    return [$user, $method, $keys];
+});
+file;
+
+        $lints = (new TLint)->lint(new NoRequestAll($file));
+
+        $this->assertEmpty($lints);
+    }
 }
Repository: maragudk/gomponents (go)
Issue: picture & img element improvements
Hi @markuswustenberg , I am really happy that I discovered your project here and I am excited to put it to good use and bring it to production for several of my clients.
I love Go, compiled language, type safety and the great re-usability that we get by using Go components.
I can only see one spot where some love is missing, and that is in the image elements.

I particularly make heavy use of the `picture` element and the `img` element in some sites. Some points I have noticed are:
- Missing `srcset` attribute in `picture` element
- Missing `loading` attribute in `img` element

With those 2 additions I can really bring this to all my current and future projects. If you don't have the time to implement this, I would also not mind tips on how to proceed adding this to the codebase, although I would be a bit lost and it would take some time.

Thanks in advance man! And thanks for this wonderful creation!
Greetings from NL 🇳🇱
Pull request description: Add loading and srcset HTML attributes
I am unsure if there are more changes needed for the 2 features of #85. Looking forward for your feedback.

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index b670b05..5a3dc3a 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -126,6 +126,10 @@ func Lang(v string) g.Node {
 	return g.Attr("lang", v)
 }
 
+func Loading(v string) g.Node {
+	return g.Attr("loading", v)
+}
+
 func Max(v string) g.Node {
 	return g.Attr("max", v)
 }
@@ -182,6 +186,10 @@ func Src(v string) g.Node {
 	return g.Attr("src", v)
 }
 
+func SrcSet(v string) g.Node {
+	return g.Attr("srcset", v)
+}
+
 func StyleAttr(v string) g.Node {
 	return g.Attr("style", v)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 1388494..76e3390 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -51,6 +51,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"href":         Href,
 		"id":           ID,
 		"lang":         Lang,
+		"loading":      Loading,
 		"max":          Max,
 		"maxlength":    MaxLength,
 		"method":       Method,
@@ -65,6 +66,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"role":         Role,
 		"rows":         Rows,
 		"src":          Src,
+		"srcset":       SrcSet,
 		"style":        StyleAttr,
 		"tabindex":     TabIndex,
 		"target":       Target,
Repository: raviqqe/muffet (go)
Issue: muffet treats preconnect hrefs like links
Websites often have code like this

```html
<link rel="preconnect" href="https://fonts.googleapis.com">
```
in order to increase performance. `https://fonts.googleapis.com` returns 404 but the HTML code is still valid and should not be checked by muffet. 


Is this a unknown issue or am I doing something wrong with muffet?  
I am willing to implement a fix for this, just lmk.
Pull request description: don't follow preconnect and dns-prefetch links
Fixes #391 

Patch:
diff --git a/link_finder.go b/link_finder.go
index 43cf934..beee40c 100644
--- a/link_finder.go
+++ b/link_finder.go
@@ -40,6 +40,16 @@ func (f linkFinder) Find(n *html.Node, base *url.URL) map[string]error {
 		_, ok := atomToAttributes[n.DataAtom]
 		return ok
 	}) {
+
+		// https://github.com/raviqqe/muffet/issues/391
+		// preconnect and dns-prefetch hrefs are not http resources
+		if n.DataAtom == atom.Link {
+			rel := scrape.Attr(n, "rel")
+			if rel == "preconnect" || rel == "dns-prefetch" {
+				continue
+			}
+		}
+
 		for _, a := range atomToAttributes[n.DataAtom] {
 			ss := f.parseLinks(n, a)
 


Test patch:
diff --git a/link_finder_test.go b/link_finder_test.go
index 20a3072..7980c5f 100644
--- a/link_finder_test.go
+++ b/link_finder_test.go
@@ -217,6 +217,36 @@ func TestLinkFinderIgnoreMetaTags(t *testing.T) {
 	assert.Len(t, ls, 0)
 }
 
+func TestLinkFinderIgnorePreconnect(t *testing.T) {
+	b, err := url.Parse("https://localhost")
+	assert.Nil(t, err)
+
+	for _, c := range []struct {
+		html      string
+		linkCount int
+	}{
+		{`<link rel="preconnect" href="https://fonts.googleapis.com">`, 0},
+		{`<link rel="dns-prefetch" href="https://fonts.googleapis.com">`, 0},
+		{`<link rel="dns-prefetch" href="https://fonts.googleapis.com"><link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,400&amp;family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;1,400&amp;display=swap" rel="stylesheet">`, 1},
+	} {
+		n, err := html.Parse(strings.NewReader(htmlWithBody(c.html)))
+		assert.Nil(t, err)
+
+		s, e := 0, 0
+
+		for _, err := range newTestLinkFinder().Find(n, b) {
+			if err == nil {
+				s++
+			} else {
+				e++
+			}
+		}
+
+		assert.Equal(t, c.linkCount, s)
+		assert.Equal(t, 0, e)
+	}
+}
+
 func htmlWithBody(b string) string {
 	return fmt.Sprintf(`<html><body>%v</body></html>`, b)
 }