PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: apple/swift-syntax (swift)

Issue:
New parser fails to parse `@convention` attribute with `cType` argument inside an array type
### Issue Kind

Parse of Valid Source Failed

### Source Code

```swift
_ = [@convention(c, cType: "int (*)(int)") (Int32) -> Int32]()
```


### Description

The issue is that the implementation of `skipTypeAttribute` doesn’t skip over the `cType` argument here. We should probably be able to just `skipSingle` to skip over all the arguments.

https://github.com/apple/swift-syntax/blob/89dd2bde9404950dede113b7898c97f6e2bc2fc4/Sources/SwiftParser/Lookahead.swift#L165-L173

Pull request:
Fixes #2474
rdar://122358055

Patch:
diff --git a/Sources/SwiftParser/Lookahead.swift b/Sources/SwiftParser/Lookahead.swift
index 682e5e46f68..c8d26ce6a14 100644
--- a/Sources/SwiftParser/Lookahead.swift
+++ b/Sources/SwiftParser/Lookahead.swift
@@ -162,14 +162,11 @@ extension Parser.Lookahead {
     if let (attr, handle) = self.at(anyIn: TypeAttribute.self) {
       // Ok, it is a valid attribute, eat it, and then process it.
       self.eat(handle)
-      if case .convention = attr {
-        guard
-          self.consume(if: .leftParen) != nil,
-          self.consume(if: .identifier) != nil,
-          self.consume(if: .rightParen) != nil
-        else {
-          return
-        }
+      switch attr {
+      case .convention:
+        self.skipSingle()
+      default:
+        break
       }
       return
     }


Test patch:
diff --git a/Tests/SwiftParserTest/AttributeTests.swift b/Tests/SwiftParserTest/AttributeTests.swift
index 906eae1abab..3ce6b32508e 100644
--- a/Tests/SwiftParserTest/AttributeTests.swift
+++ b/Tests/SwiftParserTest/AttributeTests.swift
@@ -886,4 +886,25 @@ final class AttributeTests: ParserTestCase {
       """
     )
   }
+
+  func testConventionAttributeInArrayType() {
+    assertParse(
+      """
+      _ = [@convention(c, cType: "int (*)(int)") (Int32) -> Int32]()
+      """,
+      substructure: ConventionAttributeArgumentsSyntax(
+        conventionLabel: .identifier("c"),
+        comma: .commaToken(),
+        cTypeLabel: .keyword(.cType),
+        colon: .colonToken(),
+        cTypeString: StringLiteralExprSyntax(
+          openingQuote: .stringQuoteToken(),
+          segments: StringLiteralSegmentListSyntax([
+            StringLiteralSegmentListSyntax.Element(StringSegmentSyntax(content: .stringSegment("int (*)(int)")))
+          ]),
+          closingQuote: .stringQuoteToken()
+        )
+      )
+    )
+  }
 }
Repository: prometheus/common (go)

Issue:
Authorization credentials should be optional
As part of [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-introduction), authorization is defined in ABNF as:

```
Authorization = auth-scheme [ 1*SP ( token68 / [ auth-param *( OWS "," OWS auth-param ) ] ) ]
```

This means that the scheme MUST be provided but credentials are optional.

Pull request:
Allow using empty Authorization credentials
Resolves #545. Looks like we didn't have any validation here. That may make this a breaking change if users rely on this (incorrect) behavior.

cc @roidelapluie who seems to have written most of the original code. :)

Patch:
diff --git a/config/http_config.go b/config/http_config.go
index 4763549..14ee673 100644
--- a/config/http_config.go
+++ b/config/http_config.go
@@ -546,10 +546,10 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HT
 
 		// If a authorization_credentials is provided, create a round tripper that will set the
 		// Authorization header correctly on each request.
-		if cfg.Authorization != nil && len(cfg.Authorization.Credentials) > 0 {
-			rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, cfg.Authorization.Credentials, rt)
-		} else if cfg.Authorization != nil && len(cfg.Authorization.CredentialsFile) > 0 {
+		if cfg.Authorization != nil && len(cfg.Authorization.CredentialsFile) > 0 {
 			rt = NewAuthorizationCredentialsFileRoundTripper(cfg.Authorization.Type, cfg.Authorization.CredentialsFile, rt)
+		} else if cfg.Authorization != nil {
+			rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, cfg.Authorization.Credentials, rt)
 		}
 		// Backwards compatibility, be nice with importers who would not have
 		// called Validate().


Test patch:
diff --git a/config/http_config_test.go b/config/http_config_test.go
index 4ebe038..72d1e79 100644
--- a/config/http_config_test.go
+++ b/config/http_config_test.go
@@ -269,6 +269,27 @@ func TestNewClientFromConfig(t *testing.T) {
 					fmt.Fprint(w, ExpectedMessage)
 				}
 			},
+		}, {
+			clientConfig: HTTPClientConfig{
+				Authorization: &Authorization{
+					Type: AuthorizationType,
+				},
+				TLSConfig: TLSConfig{
+					CAFile:             TLSCAChainPath,
+					CertFile:           ClientCertificatePath,
+					KeyFile:            ClientKeyNoPassPath,
+					ServerName:         "",
+					InsecureSkipVerify: false},
+			},
+			handler: func(w http.ResponseWriter, r *http.Request) {
+				bearer := r.Header.Get("Authorization")
+				if strings.TrimSpace(bearer) != AuthorizationType {
+					fmt.Fprintf(w, "The expected Bearer Authorization (%s) differs from the obtained Bearer Authorization (%s)",
+						AuthorizationType, bearer)
+				} else {
+					fmt.Fprint(w, ExpectedMessage)
+				}
+			},
 		}, {
 			clientConfig: HTTPClientConfig{
 				Authorization: &Authorization{