From 00a96c423cebb8256fbae6d8aafc6fa6756378e6 Mon Sep 17 00:00:00 2001 From: Juan Peri Date: Sun, 1 Sep 2024 10:07:22 +0200 Subject: [PATCH] add missing step for Cobertura's range (#329) Without this change, the output is full of warnings such as ``` warning: negative steps are not supported in String.slice/2, pass 44..-1//1 instead ``` --- 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