Skip to content

Commit

Permalink
add missing step for Cobertura's range (#329)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
juanperi authored Sep 1, 2024
1 parent 91a8267 commit 00a96c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/excoveralls/cobertura.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00a96c4

Please sign in to comment.