rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.91k stars 414 forks source link

fix: neg steps of {Enum,String}.slice/2 are deprecated in Elixir 1.16 #1099

Closed fishtreesugar closed 7 months ago

fishtreesugar commented 8 months ago

As mentioned in Elixir 1.16's changelog:

[Enum] Deprecate passing a range with negative step on Enum.slice/2, give first..last//1 instead [String] Deprecate passing a range with negative step on String.slice/2, give first..last//1 instead

rrrene commented 8 months ago

Hi.

Did this give you a warning with Elixir 1.16? I can't seem to reproduce a warning.

fishtreesugar commented 8 months ago

Yes, it shown when running w/ Elixir 1.16

rrrene commented 8 months ago

Strange. We tried to avoid this scenario. 😰

What system are you running this on? And which versions of OTP/Credo?

rrrene commented 7 months ago

Hi, since I was not able to reproduce this with any of my friends or in GitHub actions (where we now have a Mac runner because of this issue 👍 ), I am closing this.

If anyone has any issues with this in the future, please comment and/or re-open! 🙏