Hi Thibaut,
There are two questions I asked myself:
1. What are the broadcast cases we can warn on to help people running into
situations like these?
2. Can we emit false positives?
One thing to keep in mind is that looking for "iex>" is already a bit lax
today as it doesn't consider indentation. So having any line starting with
"iex>" will be considered a doctest. Adding rules like "iex >" may make
false positives more possible then, especially if we try to detect other
typos.
So at the moment, I am not sure if it is worth it. It feels like this
should be solved somehow (maybe change editors to highlight it), but I am
not convinced.
What are everyone's thoughts?
On Thu, Feb 3, 2022 at 6:10 PM thibaut...@gmail.com <
thibaut.barr...@gmail.com> wrote:
> Hello,
>
> While debugging some doctests I haven't written initially myself, I
> realised that one can create doctests that are bogus and will be skipped
> quite easily, just like this:
>
> ## Examples
> iex > SomeModule.some_method("param")
> "expected_output"
>
> The culprit is the extra space between "iex" and ">", which prevents the
> test from being executed (and the developer is not aware of that at all!).
>
> I wonder if some form of protection against that could be made, either in
> Elixir or in Credo maybe?
>
> Not a huge issue, but it could result in some head-banging for some :-)
>
> -- Thibaut
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/bf7c0071-5540-409c-8e63-bdcf31fca68bn%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/bf7c0071-5540-409c-8e63-bdcf31fca68bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LXdLF1EJa7G%2BWMmxvRfEdGLYxs%2Bi9%2B%3DyLiy6i0uXyzTA%40mail.gmail.com.