nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: jeremyjh/dialyxir
Pull request #280 (2018-11-30 15:09:44)

Gracefully handle error when loading application
Since Application.load/1 returns errors as tuples, we can't just
interpolate them into the error message, but we need to call "inspect"
first.  Without this change, running dialyxir on an application whose
run-time dependencies cannot be found fails with an error:

    ** (Protocol.UndefinedError) protocol String.Chars not implemented for {'no such file or directory', 'nonexistent.app'}. This protocol is implemented for: Atom, BitString, Date, DateTime, Float, Integer, List, NaiveDateTime, Time, URI, Version, Version.Requirement


Patch:
diff --git a/lib/dialyxir/project.ex b/lib/dialyxir/project.ex
index 121d64c..ca49c0d 100644
--- a/lib/dialyxir/project.ex
+++ b/lib/dialyxir/project.ex
@@ -277,7 +277,7 @@ defmodule Dialyxir.Project do
 
       {:error, err} ->
         nil
-        error("Error loading #{app}, dependency list may be incomplete.\n #{err}")
+        error("Error loading #{app}, dependency list may be incomplete.\n #{inspect(err)}")
     end
 
     case Application.spec(app, :applications) do


Test patch:
diff --git a/test/dialyxir/project_test.exs b/test/dialyxir/project_test.exs
index 38771c9..226d751 100644
--- a/test/dialyxir/project_test.exs
+++ b/test/dialyxir/project_test.exs
@@ -2,7 +2,7 @@ defmodule Dialyxir.ProjectTest do
   alias Dialyxir.Project
 
   use ExUnit.Case
-  import ExUnit.CaptureIO, only: [capture_io: 1]
+  import ExUnit.CaptureIO, only: [capture_io: 1, capture_io: 2]
 
   defp in_project(app, f) when is_atom(app) do
     Mix.Project.in_project(app, "test/fixtures/#{Atom.to_string(app)}", fn _ -> f.() end)
@@ -147,4 +147,11 @@ defmodule Dialyxir.ProjectTest do
       assert lines == ["project.ex:9 This should still be here"]
     end)
   end
+
+  test "Project with non-existent dependency" do
+    in_project(:nonexistent_deps, fn ->
+      out = capture_io(:stderr, &Project.cons_apps/0)
+      assert Regex.match?(~r/Error loading nonexistent, dependency list may be incomplete/, out)
+    end)
+  end
 end
diff --git a/test/fixtures/nonexistent_deps/mix.exs b/test/fixtures/nonexistent_deps/mix.exs
new file mode 100644
index 0000000..8e04549
--- /dev/null
+++ b/test/fixtures/nonexistent_deps/mix.exs
@@ -0,0 +1,17 @@
+defmodule NonexistentDeps.Mixfile do
+  use Mix.Project
+
+  def project do
+    [app: :nonexistent_deps, version: "0.1.0", deps: deps()]
+  end
+
+  def application do
+    # This application has a run-time dependency on a non-existent
+    # application.
+    [applications: [:logger, :public_key, :nonexistent]]
+  end
+
+  defp deps do
+    []
+  end
+end
Repository: jeremyjh/dialyxir
Pull request #396 (2020-05-13 14:29:40)

Base PLT hash on mix.lock
https://github.com/jeremyjh/dialyxir/issues/395


Patch:
diff --git a/lib/mix/tasks/dialyzer.ex b/lib/mix/tasks/dialyzer.ex
index 2432c9a..b793268 100644
--- a/lib/mix/tasks/dialyzer.ex
+++ b/lib/mix/tasks/dialyzer.ex
@@ -376,10 +376,13 @@ defmodule Mix.Tasks.Dialyzer do
 
   @spec dependency_hash :: {[atom()], binary()}
   def dependency_hash do
-    lock_file = Mix.Dep.Lock.read() |> :erlang.term_to_binary()
     apps = Project.cons_apps()
     apps |> inspect() |> info()
-    hash = :crypto.hash(:sha, lock_file <> :erlang.term_to_binary(apps))
+    hash = :crypto.hash(:sha, lock_file() <> :erlang.term_to_binary(apps))
     {apps, hash}
   end
+
+  def lock_file() do
+    Mix.Project.config()[:lockfile] |> File.read!()
+  end
 end


Test patch:
diff --git a/test/fixtures/local_plt/mix.lock b/test/fixtures/local_plt/mix.lock
new file mode 100644
index 0000000..7590ca8
--- /dev/null
+++ b/test/fixtures/local_plt/mix.lock
@@ -0,0 +1,1 @@
+%{}
Repository: jeremyjh/dialyxir
Pull request #485 (2023-03-19 15:27:12)

Use explicit ubuntu version with matrix support.
`ubuntu-latest` is a moving target, it now points to 22 which has [little support](https://github.com/erlef/setup-beam#compatibility-between-operating-system-and-erlangotp) for older OTP versions. Arguably our matrix is a little too conservative with retaining older versions and we're also updating our matrix but I think OTP 23 support is still reasonable and anyway I'd rather pin to a specific release.


Patch:
diff --git a/.tool-versions b/.tool-versions
index a3c95f7..b245c79 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1,2 +1,2 @@
-elixir 1.12.2
-erlang 24.0.5
+elixir 1.14.3-otp-25
+erlang 25.2.2
diff --git a/lib/dialyxir/project.ex b/lib/dialyxir/project.ex
index d9f2b9c..3308cc2 100644
--- a/lib/dialyxir/project.ex
+++ b/lib/dialyxir/project.ex
@@ -42,7 +42,7 @@ defmodule Dialyxir.Project do
 
   def cons_apps do
     # compile & load all deps paths
-    Mix.Tasks.Deps.Loadpaths.run([])
+    _ = Mix.Tasks.Deps.Loadpaths.run([])
     # compile & load current project paths
     Mix.Task.run("compile")
     apps = plt_apps() || plt_add_apps() ++ include_deps()


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7793495..9a55700 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -10,13 +10,14 @@ jobs:
   check_duplicate_runs:
     name: Check for duplicate runs
     continue-on-error: true
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     outputs:
       should_skip: ${{ steps.skip_check.outputs.should_skip }}
     steps:
       - id: skip_check
         uses: fkirc/skip-duplicate-actions@master
         with:
+          github_token: ${{ github.token }}
           concurrent_skipping: always
           cancel_others: true
           skip_after_successful_duplicate: true
@@ -25,7 +26,7 @@ jobs:
 
   test:
     name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     needs: check_duplicate_runs
     if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}
 
@@ -33,16 +34,17 @@ jobs:
       fail-fast: false
       matrix:
         elixir:
-        - '1.10.4'
-        - '1.11.4'
-        - '1.12.2'
+        - '1.12.3'
+        - '1.13.4'
+        - '1.14.3'
         otp:
-        - '22.3'
         - '23.3'
-        - '24.0'
+        - '24.3'
+        - '25.3'
+
         exclude:
-          - elixir: '1.10.4'
-            otp: '24.0'
+          - elixir: '1.12.3'
+            otp: '25.3'
 
     steps:
     - name: Checkout