parroty / excoveralls

Coverage report tool for Elixir with coveralls.io integration.
MIT License
820 stars 178 forks source link

Use explicit steps to remove 1.16 deprecation warning in Cobertura #322

Closed gitneko closed 5 months ago

gitneko commented 8 months ago

Since Elixir v1.16 negative slices (steps) to String.slice/2 have been deprecated and throws a warning for each call when running mix coveralls.cobertura.

Example warning:

warning: negative steps are not supported in String.slice/2, pass 31..-1//1 instead

This PR removes the warning by using explicit steps as the warning message recommends. However since this library supports also v1.11, which does not support explicit steps yet, this PR conditionally calls Range.new/3 instead of using x..y//step. Otherwise we would get a syntax error during compilation on v.1.11.

Let me know if there is anything else that needs to be done in this PR.

parroty commented 5 months ago

Thank you and sorry being late to merge 🙇