PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: CuyZ/Valinor (php)
Issue: Unsealed array with trailing comma causes parse error
Valinor currently fails to parse an unsealed array with a trailing comma:
```php
class Foo
{
    /**
     * @param array{
     *     a: int,
     *     b: int,
     *     ...,
     * } $arr
     */
    public function __construct(private readonly array $arr) {}
}

$foo = (new \CuyZ\Valinor\MapperBuilder())
    ->allowPermissiveTypes()
    ->mapper()
    ->map(Foo::class, ["arr" => ["a" => 1, "b" => 2]])
;
```
It's debatable whether this trailing comma is really appropriate, since `...` must appear last the comma isn't useful for diffs, but since Psalm and PHPStan both support it I think it would be good for it not to cause a parsing error.
Pull request description: misc: handle trailing comma in shaped array declaration
Fixes #566

Patch:
diff --git a/src/Type/Parser/Lexer/Token/ArrayToken.php b/src/Type/Parser/Lexer/Token/ArrayToken.php
index 57bcd85..703d31f 100644
--- a/src/Type/Parser/Lexer/Token/ArrayToken.php
+++ b/src/Type/Parser/Lexer/Token/ArrayToken.php
@@ -137,7 +137,7 @@ final class ArrayToken implements TraversingToken
 
             if ($stream->next() instanceof VacantToken) {
                 $type = new StringValueType($stream->forward()->symbol());
-            } elseif ($isUnsealed && $stream->next() instanceof ClosingCurlyBracketToken) {
+            } elseif ($isUnsealed && ($stream->next() instanceof ClosingCurlyBracketToken || $stream->next() instanceof CommaToken)) {
                 $stream->forward();
                 break;
             } else {


Test patch:
diff --git a/tests/Functional/Type/Parser/LexingParserTest.php b/tests/Functional/Type/Parser/LexingParserTest.php
index 88d9903..0a32700 100644
--- a/tests/Functional/Type/Parser/LexingParserTest.php
+++ b/tests/Functional/Type/Parser/LexingParserTest.php
@@ -738,6 +738,18 @@ final class LexingParserTest extends TestCase
             'type' => ShapedArrayType::class,
         ];
 
+        yield 'Unsealed shaped array' => [
+            'raw' => 'array{foo: string, ...}',
+            'transformed' => 'array{foo: string, ...}',
+            'type' => ShapedArrayType::class,
+        ];
+
+        yield 'Unsealed shaped array with trailing comma' => [
+            'raw' => 'array{foo: string, ...,}',
+            'transformed' => 'array{foo: string, ...}',
+            'type' => ShapedArrayType::class,
+        ];
+
         yield 'Iterable type' => [
             'raw' => 'iterable',
             'transformed' => 'iterable',
Repository: bombsimon/wsl (go)
Issue: Multilin case statements should be allowed
It's not possible to break cases into multiple lines but it really should!

```go
switch {
case true, // Does work for *first* statement.
	false:
	fmt.Println("x")
case true, // Doesn't work here
	false:
	fmt.Println("x")
case true || // Same with || operator
	false:
	fmt.Println("x")
case true, false: // Ok
	fmt.Println("x")
case true || false: // Ok
	fmt.Println("x")
}

```
Pull request description: Check next block start by case, not colon
This resolves #29 

Patch:
diff --git a/wsl.go b/wsl.go
index ff5798d..eb98deb 100644
--- a/wsl.go
+++ b/wsl.go
@@ -815,9 +815,9 @@ func (p *Processor) findLeadingAndTrailingWhitespaces(stmt, nextStatement ast.No
 
 		switch n := nextStatement.(type) {
 		case *ast.CaseClause:
-			blockEndPos = n.Colon
+			blockEndPos = n.Case
 		case *ast.CommClause:
-			blockEndPos = n.Colon
+			blockEndPos = n.Case
 		default:
 			// We're not at the end of the case?
 			return


Test patch:
diff --git a/wsl_test.go b/wsl_test.go
index 557e849..ae8a5ab 100644
--- a/wsl_test.go
+++ b/wsl_test.go
@@ -1014,6 +1014,47 @@ func TestShouldAddEmptyLines(t *testing.T) {
 				"if statements should only be cuddled with assignments used in the if statement itself",
 			},
 		},
+		{
+			description: "multiline case statements",
+			code: []byte(`package main
+
+			func main() {
+				switch {
+				case true,
+					false:
+					fmt.Println("ok")
+				case true ||
+					false:
+					fmt.Println("ok")
+				case true, false:
+					fmt.Println("ok")
+				case true || false:
+					fmt.Println("ok")
+				case true,
+					false:
+
+					fmt.Println("starting whitespace multiline case")
+				case true ||
+					false:
+
+					fmt.Println("starting whitespace multiline case")
+				case true,
+					false:
+					fmt.Println("ending whitespace multiline case")
+
+				case true,
+					false:
+					fmt.Println("last case should also fail")
+
+				}
+			}`),
+			expectedErrorStrings: []string{
+				"block should not end with a whitespace (or comment)",
+				"block should not start with a whitespace",
+				"block should not start with a whitespace",
+				"block should not end with a whitespace (or comment)",
+			},
+		},
 	}
 
 	for _, tc := range cases {