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

Predicate callbacks from behavior are not ignored #1108

Closed jjcarstens closed 5 months ago

jjcarstens commented 8 months ago

Precheck

Environment

What were you trying to do?

NervesSSH implements the Erlang :ssh_server_key_api behavior which has an is_auth_key/3 callback definition. The currently fails the predicate check despite it having @impl :ssh_server_key_api.

This might be an extreme edge case and maybe not need to be handled, but wanted to bring attention just in case

Expected outcome

Passing when is_* function is an implementation of a behavior callback.

Actual outcome

> nerves_ssh ?4 % mix credo -a --strict
Checking 11 source files ...

  Code Readability                                                                                                                                                                   
┃ 
┃ [R] ↗ Predicate function names should not start with 'is', and should end in a question mark.
┃       lib/nerves_ssh/keys.ex:14:7 #(NervesSSH.Keys.is_auth_key)
rrrene commented 8 months ago

Thx for reporting! :+1:

This is definitely an issue that we should solve!

rrrene commented 5 months ago

@jjcarstens 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! 👍