Open dabaer opened 3 years ago
The reason is simply that I have no idea how to parse .eex
and .leex
templates 😉
Unfortunately that makes two of us 😅
I'll try and take a cursory peek into doing that, but likely it will happen after a major release at work here shortly.
:+1:
My research got as far as EEx.SmartEngine
, but I seem to recall that that would not give us an AST to work with.
With Elixir 1.14.x there's now the EEx.tokenize/2 function.
I've used this to write a crude custom check that also handles elixir expressions in LiveView's sigil_H
blocks.
Environment
mix credo -v
): 1.5.4-ref.nobranch.nocommitelixir -v
): Elixir 1.11.2 (compiled with Erlang/OTP 23)What were you trying to do?
Track down a confusing output in the terminal whilst testing. It turned out to be an errant IO.inspect call in one of my templates.
Expected outcome
For Credo to detect the IO.inspect call.
Actual outcome
Credo did not detect the IO.inspect call.
I am able to reproduce this with a stock phx.new project, by adding a call to IO.inspect in the page index template (or any template).
Is this supposed to be by design?