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.94k stars 419 forks source link

Removing map.field notation and x..-y warnings #1102

Closed bradhanks closed 10 months ago

bradhanks commented 11 months ago

There are two warnings showing up that I worked on removing:

warning: using map.field notation (without parentheses) to invoke function Credo.Check.Refactor.MatchInCondition.param_defaults() is deprecated, you must add parentheses instead: remote.function()

There's still one warning at: (credo 1.7.2) lib/credo/check/params.ex:39: Credo.Check.Params.get/3 but I think it is a mistake.

I also went through and added an explicit step value to descending ranges

rrrene commented 11 months ago

Hi, where are you getting these warnings? I can't reproduce them locally and the GitHub actions runners also don't show warnings in the logs.

bradhanks commented 11 months ago

I think the issue is that the CI tests need to be updated to a newer version of Elixir. The current tests don't recognize Range.new/3 which has been around since 1.12

rrrene commented 11 months ago

Could you please answer the question?

Which OS/OTP/Elixir version are you getting the aforementioned warnings on?

bradhanks commented 11 months ago

Could you please answer the question?

Which OS/OTP/Elixir version are you getting the aforementioned warnings on? Oh yeah sorry about that. It's 1.11.4

image
rrrene commented 11 months ago

I mean the warnings that prompted you to create this PR. Where did you get those?

bradhanks commented 11 months ago

I ran mix credo on the credo master branch.

Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] [dtrace]

Elixir 1.16.0 (compiled with Erlang/OTP 26)

rrrene commented 10 months ago

And which OS?

bradhanks commented 10 months ago

MacOS 13.4.1 (c) (22F770820d

rrrene commented 10 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! 🙏