PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: Behat/Gherkin (php)

Issue:
Whitespace around language stops detection
We do things slightly differently to cucumber, removing this line will cause a failing test

https://github.com/Behat/Gherkin/blob/efdbe73e590320b9fab535ef3a7c28319b3a063a/tests/Cucumber/CompatibilityTest.php#L55

Pull request:
feat: Support language tags with whitespace in `gherkin-32` mode
Matches cucumber/gherkin behaviour by allowing language tags with additional whitespace either side of the keyword e.g.

```
 #  language  :   en-lol
```

Fixes #206

Patch:
diff --git a/src/GherkinCompatibilityMode.php b/src/GherkinCompatibilityMode.php
index 6ed5a33..ab80399 100644
--- a/src/GherkinCompatibilityMode.php
+++ b/src/GherkinCompatibilityMode.php
@@ -42,4 +42,15 @@ enum GherkinCompatibilityMode: string
             default => false,
         };
     }
+
+    /**
+     * @internal
+     */
+    public function allowWhitespaceInLanguageTag(): bool
+    {
+        return match ($this) {
+            self::LEGACY => false,
+            default => true,
+        };
+    }
 }
diff --git a/src/Lexer.php b/src/Lexer.php
index 73244f4..20c13fa 100644
--- a/src/Lexer.php
+++ b/src/Lexer.php
@@ -789,7 +789,11 @@ class Lexer
             return null;
         }
 
-        $token = $this->scanInput('/^\s*#\s*language:\s*([\w_\-]+)\s*$/', 'Language');
+        $pattern = $this->compatibilityMode->allowWhitespaceInLanguageTag()
+            ? '/^\s*#\s*language\s*:\s*([\w_\-]+)\s*$/u'
+            : '/^\s*#\s*language:\s*([\w_\-]+)\s*$/';
+
+        $token = $this->scanInput($pattern, 'Language');
 
         if ($token) {
             \assert(\is_string($token['value']));


Test patch:
diff --git a/tests/Cucumber/CompatibilityTest.php b/tests/Cucumber/CompatibilityTest.php
index c181944..33ac5d5 100644
--- a/tests/Cucumber/CompatibilityTest.php
+++ b/tests/Cucumber/CompatibilityTest.php
@@ -68,7 +68,6 @@ class CompatibilityTest extends TestCase
             'descriptions_with_comments.feature' => 'Examples table descriptions not supported',
             'feature_keyword_in_scenario_description.feature' => 'Scenario descriptions not supported',
             'padded_example.feature' => 'Table padding is not trimmed as aggressively',
-            'spaces_in_language.feature' => 'Whitespace not supported around language selector',
             'rule_without_name_and_description.feature' => 'Rule is wrongly parsed as Description',
             'incomplete_background_2.feature' => 'Background descriptions not supported',
         ],
Repository: phoenixframework/phoenix (elixir)

Issue:
Could not check origin for Phoenix.Socket transport. Can we log the origin?
### Issue

I am having an issue with the socket connection, I have some connections from a website that I ignore, I would like to know what's the origin. 

I have logged and found were the requests were coming from using a plug before `sockets` in the endpoint.ex file.

But, would it be possible to log the origin in: https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/socket/transport.ex#L363
I can help.

### Environment

* Elixir version (elixir -v): Elixir 1.6.6 (compiled with OTP 20)
* Phoenix version (mix deps): 1.3.3
* Operating system: Mac os

Pull request:
log origin when error on check_origin
fixes #2983

Patch:
diff --git a/lib/phoenix/socket/transport.ex b/lib/phoenix/socket/transport.ex
index 9ebe72ad8..66609db1e 100644
--- a/lib/phoenix/socket/transport.ex
+++ b/lib/phoenix/socket/transport.ex
@@ -363,6 +363,8 @@ defmodule Phoenix.Socket.Transport do
         Logger.error """
         Could not check origin for Phoenix.Socket transport.
 
+        Origin of the request: #{origin}
+
         This happens when you are attempting a socket connection to
         a different host than the one configured in your config/
         files. For example, in development the host is configured


Test patch:
diff --git a/test/phoenix/socket/transport_test.exs b/test/phoenix/socket/transport_test.exs
index b81a383d4..888ce00af 100644
--- a/test/phoenix/socket/transport_test.exs
+++ b/test/phoenix/socket/transport_test.exs
@@ -1,9 +1,11 @@
 System.put_env("TRANSPORT_TEST_HOST", "host.com")
 
 defmodule Phoenix.Socket.TransportTest do
-  use ExUnit.Case, async: true
+  use ExUnit.Case, async: false
   use RouterHelper
 
+  import ExUnit.CaptureLog
+
   alias Phoenix.Socket.Transport
 
   Application.put_env :phoenix, __MODULE__.Endpoint,
@@ -79,15 +81,21 @@ defmodule Phoenix.Socket.TransportTest do
       assert conn.halted
     end
 
-
     test "halts invalid URIs when check origin is configured" do
+      Logger.enable(self())
       origins = ["//example.com", "http://scheme.com", "//port.com:81"]
 
-      for config <- [origins, true] do
-        assert check_origin("file://", check_origin: config).halted
-        assert check_origin("null", check_origin: config).halted
-        assert check_origin("", check_origin: config).halted
-      end
+      logs =
+        capture_log(fn ->
+          for config <- [origins, true] do
+            assert check_origin("file://", check_origin: config).halted
+            assert check_origin("null", check_origin: config).halted
+            assert check_origin("", check_origin: config).halted
+          end
+        end)
+
+      assert logs =~ "file://"
+      assert logs =~ "null"
     end
 
     def invalid_allowed?(%URI{host: nil}), do: true