We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mix credo -v
1.7.5-ref.master.c5b4d38+uncommittedchanges
elixir -v
Erlang/OTP 25 [erts-13.2.2.6] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] Elixir 1.15.7 (compiled with Erlang/OTP 25)
I have a function:
1 @spec to_def(t(), atom()) :: Macro.t() 2 def to_def(%__MODULE__{vars: vars, code: code}, name) do 3 quote generated: true do 4 def unquote(name)(unquote_splicing(vars)) do 5 unquote(code) 6 end 7 end 8 end
It does not complain that line 4 has no spec, since it is a generated function
It complains that the def on line 4 has no spec
Code Readability ┃ ┃ [R] → Functions should have a @spec type specification. ┃ lib/file.ex:4:column #(Module.to_def)
Run mix credo here: https://github.com/hissssst/pathex
mix credo
The text was updated successfully, but these errors were encountered:
Thx for reporting! 👍
Sorry, something went wrong.
Fix false positive for Specs
c0b82e4
Refs #1123
Thanks for reporting this 😀 It is now fixed on master.
master
You can try this by setting the Credo dep to
{:credo, github: "rrrene/credo"}
Please report back if your issue is solved! 👍
This is live in v1.7.6 🎉
v1.7.6
No branches or pull requests
Environment
mix credo -v
):1.7.5-ref.master.c5b4d38+uncommittedchanges
elixir -v
):What were you trying to do?
I have a function:
Expected outcome
It does not complain that line 4 has no spec, since it is a generated function
Actual outcome
It complains that the def on line 4 has no spec
Real world example
Run
mix credo
here: https://github.com/hissssst/pathexThe text was updated successfully, but these errors were encountered: