Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest excoveralls version #1

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8212269
Cobertura now handles defprotocol and defimpl definitions (#306)
gorghoa Mar 27, 2023
07a89a3
Bump version and update CHANGELOG
parroty Mar 27, 2023
354204a
Add Cobertura docs to README.md (#312)
solar05 Jul 2, 2023
509c526
Update Elixir requirement to 1.11+ (#316)
whatyouhide Aug 1, 2023
e41649c
Replace hackney with httpc (#311)
whatyouhide Aug 9, 2023
af7ed22
Bump version and update CHANGELOG
parroty Aug 9, 2023
b475ec9
Fix lcov 2.0 source file handling (#315)
warmwaffles Aug 9, 2023
68297d0
Update CHANGELOG
parroty Aug 9, 2023
36ac3ba
Remove erroneous line in ExCoveralls.poster (#318)
whatyouhide Aug 9, 2023
ead9d5a
Import `.coverdata` after test run and improve documentation (#309)
zachallaun Aug 9, 2023
9ab49e6
Update CHANGELOG
parroty Aug 9, 2023
206e246
Accept custom http options (#319)
rodrigues Aug 27, 2023
719d364
Bump version and update CHANGELOG
parroty Aug 27, 2023
c76d8ed
Always floor coverage instead of rounding (#310)
albertored Oct 10, 2023
97476ce
Bump version and update CHANGELOG
parroty Oct 10, 2023
55686be
Update README examples (#320)
solar05 Oct 11, 2023
e61a96e
Use explicit steps to remove 1.16 deprecation warning (#322)
gitneko Apr 1, 2024
d09ee95
Update CHANGELOG and bump version
parroty Apr 1, 2024
a530769
Detect and warn about incorrectly used ignore-comments (#325)
RKushnir May 30, 2024
f66fbc7
Fix Elixir 1.17 single-quoted string warning (#327)
hkrutzer Jul 23, 2024
91a8267
Bump version and update CHANGELOG
parroty Jul 23, 2024
00a96c4
add missing step for Cobertura's range (#329)
juanperi Sep 1, 2024
b4bf930
Update CHANGELOG and version
parroty Sep 1, 2024
46d66b2
Revert "add missing step for Cobertura's range (#329)" (#330)
parroty Sep 1, 2024
d0d8891
Revert version change
parroty Sep 1, 2024
26120fb
Update Range to use function syntax (#332)
juanperi Sep 4, 2024
7952661
Update CHANGELOG and version
parroty Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use explicit steps to remove 1.16 deprecation warning (parroty#322)
gitneko authored Apr 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e61a96e9e38d7e28b7c49d8265bd81ff5c7b9f84
10 changes: 9 additions & 1 deletion lib/excoveralls/cobertura.ex
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ defmodule ExCoveralls.Cobertura do
c_paths
|> Enum.find_value(package_name, fn c_path ->
if String.starts_with?(package_name, c_path) do
String.slice(package_name, (String.length(c_path) + 1)..-1)
String.slice(package_name, get_slice_range_for_package_name(c_path))
else
false
end
@@ -183,6 +183,14 @@ defmodule ExCoveralls.Cobertura do
|> to_charlist()
end

# TODO: Remove when we require Elixir 1.12 as minimum and inline it with range syntax
if Version.match?(System.version(), ">= 1.12.0") 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
end

defp rate(valid_lines) when length(valid_lines) == 0, do: 0.0

defp rate(valid_lines) do