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

False Positive: Macro sigils with uppercase words #1124

Closed probably-not closed 5 months ago

probably-not commented 5 months ago

Environment

What were you trying to do?

defmacro sigil_WORD({:<<>>, _, [string]}, []) do
  # ...
end

Expected outcome

No warnings

Actual outcome

  Code Readability                                                                                                    
┃ 
┃ [R] ↗ Function/macro/guard names should be written in snake_case.
┃       apps/xxx_web/lib/xxx_web/sigils.ex:12:12 #(XXXWeb.Sigils.sigil_WORD)

It looks like there's older bugs from before Elixir 1.15 that talk about this: https://github.com/rrrene/credo/issues/682 But whatever the fix was does not honor the new functionality added that allows multi-character uppercase sigils

rrrene commented 5 months ago

Thx for reporting! :+1:

rrrene commented 5 months ago

Thanks for reporting this 😀 It is now fixed on master.

You can try this by setting the Credo dep to

{:credo, github: "rrrene/credo"}

Please report back if your issue is solved! 👍

probably-not commented 5 months ago

Looks like it's fixed! 🔥

Closed by https://github.com/rrrene/credo/commit/4f52c24dba91cf886bca6c6d31828323c1ca70cb

rrrene commented 3 months ago

@probably-not This is live in v1.7.6 🎉