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

refactor: avoid warning for slices #1122

Closed ViseLuca closed 5 months ago

ViseLuca commented 5 months ago
warning: negative steps are not supported in Enum.slice/2, pass 41..-1//1 instead
  (elixir 1.16.2) lib/enum.ex:2994: Enum.slice/2
  (credo 1.7.0) lib/credo/code/interpolation_helper.ex:61: Credo.Code.InterpolationHelper.replace_line/4
  (elixir 1.16.2) lib/list.ex:1351: List.do_update_at/3
  (elixir 1.16.2) lib/list.ex:1355: List.do_update_at/3
  (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (credo 1.7.0) lib/credo/code/interpolation_helper.ex:14: Credo.Code.InterpolationHelper.replace_interpolations/3
rrrene commented 5 months ago

Hi, judging from the stacktrace, you are using an old version of Credo (1.7.0).

Can you upgrade to 1.7.5 and report back?

ViseLuca commented 5 months ago

Hi, judging from the stacktrace, you are using an old version of Credo (1.7.0).

Can you upgrade to 1.7.5 and report back?

Yeah! I don't know why but dependabot was not proposing the latest release 1.7.5 and was stuck to 1.7.0! All is fixed, thank you