From 084e8817581f7faa12ec1d601d26d4e57c5b4f59 Mon Sep 17 00:00:00 2001 From: parroty Date: Sun, 1 Sep 2024 17:29:35 +0900 Subject: [PATCH 1/4] add missing step for Cobertura's range --- lib/excoveralls/cobertura.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/excoveralls/cobertura.ex b/lib/excoveralls/cobertura.ex index 9e43540d..d76c2d06 100644 --- a/lib/excoveralls/cobertura.ex +++ b/lib/excoveralls/cobertura.ex @@ -188,7 +188,7 @@ defmodule ExCoveralls.Cobertura do # We use Range.new/3 because using x..y//step would give a syntax error on Elixir < 1.12 defp get_slice_range_for_package_name(c_path), do: Range.new(String.length(c_path) + 1, -1, 1) else - defp get_slice_range_for_package_name(c_path), do: (String.length(c_path) + 1)..-1 + defp get_slice_range_for_package_name(c_path), do: (String.length(c_path) + 1)..-1//1 end defp rate(valid_lines) when length(valid_lines) == 0, do: 0.0 From 85ca7933f2161bc30f7379a4a506352a4b0a4224 Mon Sep 17 00:00:00 2001 From: Juan Peri Date: Mon, 2 Sep 2024 09:10:47 +0200 Subject: [PATCH 2/4] Update Range to use function syntax --- lib/excoveralls/cobertura.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/excoveralls/cobertura.ex b/lib/excoveralls/cobertura.ex index d76c2d06..dd58bd2e 100644 --- a/lib/excoveralls/cobertura.ex +++ b/lib/excoveralls/cobertura.ex @@ -188,7 +188,7 @@ defmodule ExCoveralls.Cobertura do # We use Range.new/3 because using x..y//step would give a syntax error on Elixir < 1.12 defp get_slice_range_for_package_name(c_path), do: Range.new(String.length(c_path) + 1, -1, 1) else - defp get_slice_range_for_package_name(c_path), do: (String.length(c_path) + 1)..-1//1 + defp get_slice_range_for_package_name(c_path), do: Range.new(String.length(c_path) + 1, -1) end defp rate(valid_lines) when length(valid_lines) == 0, do: 0.0 From cc1e82b654f75a7f39004935f66f0f008c2c4fbe Mon Sep 17 00:00:00 2001 From: Juan Peri Date: Mon, 2 Sep 2024 09:29:52 +0200 Subject: [PATCH 3/4] run tests in elixir 1.17 --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 539d207a..9123df3a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,8 @@ jobs: elixir: '1.11' - otp: '26.0' elixir: '1.15' + - otp: '27.0' + elixir: '1.17' env: MIX_ENV: test GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a05cccaa4fdf1536606d0434cbe85f41e833ea53 Mon Sep 17 00:00:00 2001 From: Juan Peri Date: Mon, 2 Sep 2024 09:53:43 +0200 Subject: [PATCH 4/4] fix test with relative path --- test/settings_test.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/settings_test.exs b/test/settings_test.exs index 07c3197c..66e5869f 100644 --- a/test/settings_test.exs +++ b/test/settings_test.exs @@ -15,7 +15,8 @@ defmodule Excoveralls.SettingsTest do test "returns default file path" do assert(Settings.Files.default_file - |> Path.relative_to(File.cwd!) == "lib/excoveralls/../conf/coveralls.json") + |> Path.expand() + |> Path.relative_to(File.cwd!) == "lib/conf/coveralls.json") end test "returns custom file path" do